i have an exercise which i must write a programm in which i manage the timetable of trains.I write all the programm put i can not write the main class, because i must make an Arraylist with 3 passengers and i dont know what i must put in the blank
Code:
public class Route {
private int id;
private int aeroplane;
private String departure;
private String arrival;
private ArrayList<Ticket> Tickets = new ArrayList<>() ;
public Route(){
id = 0 ;
aeroplane = 0 ;
departure = " ";
arrival = " ";
Tickets = new ArrayList<>();
}
public Route(int ID, int aerop, String depar,String arriv,ArrayList<Ticket> tick ){
id=ID;
aeroplane=aerop;
departure=depar;
arrival=arriv;
Tickets=tick;
}
public static void main(String[] args) {
ArrayList <Train> train=new ArrayList<>();
Route d1= new Route(0051,50,"Greece","Italy",);// what i have to write in the last blank?
}}
Ticketsshould be of typeList<Ticket>this.ticketsto reference the field in the class and useticketsas an argument. The assignment looks like this:this.tickets = tickets.