Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- BusCompany eged = new BusCompany("Eged");
- Bus bus1 = new Bus(1, 30);
- Bus bus2 = new Bus(12, 50);
- Bus bus3 = new Bus(20, 40);
- eged.addBus(bus1);
- eged.addBus(bus2);
- eged.addBus(bus3);
- System.out.println(bus1);
- System.out.println(bus2);
- System.out.println(bus3);
- System.out.println(eged);
- eged.removeBus(12);
- System.out.println(eged);
- Line line3 = new Line(3, "Tel-Aviv", "Haifa");
- Line line4 = new Line(4, "Haifa", "Tel-Aviv");
- Trip trip1 = new Trip("20th of September", "20:00", line3, bus3);
- Trip trip2 = new Trip("20th of September", "23:00", line4, bus1);
- eged.addTrip(trip1);
- eged.addTrip(trip2);
- System.out.println(eged);
- eged.removeTrip(trip2);
- System.out.println(eged);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement