Advertisement
_MuradPro_

Main

Sep 28th, 2020
1,567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1.  
  2. public class Main {
  3.  
  4.     public static void main(String[] args) {
  5.         BusCompany eged = new BusCompany("Eged");
  6.        
  7.         Bus bus1 = new Bus(1, 30);
  8.         Bus bus2 = new Bus(12, 50);
  9.         Bus bus3 = new Bus(20, 40);
  10.        
  11.         eged.addBus(bus1);
  12.         eged.addBus(bus2);
  13.         eged.addBus(bus3);
  14.        
  15.         System.out.println(bus1);
  16.         System.out.println(bus2);
  17.         System.out.println(bus3);
  18.        
  19.         System.out.println(eged);
  20.        
  21.         eged.removeBus(12);    
  22.         System.out.println(eged);
  23.        
  24.         Line line3 = new Line(3, "Tel-Aviv", "Haifa");
  25.         Line line4 = new Line(4, "Haifa", "Tel-Aviv");
  26.  
  27.        
  28.         Trip trip1 = new Trip("20th of September", "20:00", line3, bus3);
  29.         Trip trip2 = new Trip("20th of September", "23:00", line4, bus1);
  30.        
  31.         eged.addTrip(trip1);
  32.         eged.addTrip(trip2);
  33.        
  34.         System.out.println(eged);
  35.        
  36.         eged.removeTrip(trip2);
  37.        
  38.         System.out.println(eged);
  39.        
  40.     }
  41.  
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement