Java

 0    4 fiche    guest3222373
Télécharger mP3 Imprimer jouer consultez
 
question język polski réponse język polski
Stwórz klase TrainService posiadający pole listę pociągów
commencer à apprendre
private<List>Train trains; konstruktor
Metoda dodaje pociągi podane w parametrze do listy
commencer à apprendre
public void addTrain (Train train) {trans. add(train)};
Metoda usuwa pociągi podane w parametrze z listy
commencer à apprendre
public void removeTrain(Train train) {trains. remove(train)};
Metoda wyświetla wszystkie pociągi w liście z toString
commencer à apprendre
public void display() {for (Train train: trains) {sout(train. toString());}}

Vous devez vous connecter pour poster un commentaire.