Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package lab05;
  2.  
  3. /*
  4. * G��wna klasa kt�ra przeprowadza wielow�tkowy wy�cig
  5. */
  6.  
  7. public class Main {
  8.  
  9. public static void main(String[] args) throws InterruptedException {
  10.  
  11. //tworzymy wy�cig oraz stacj� paliw
  12. Wyscig wyscig = new Wyscig();
  13. Tankowanie tankowanie = new Tankowanie();
  14.  
  15. //tworzym samochody - w�tki
  16. new Thread(new Samochod("Ferrari F430", wyscig, tankowanie)).start();
  17. new Thread(new Samochod("Mercedes AMG GT", wyscig, tankowanie)).start();
  18. new Thread(new Samochod("Maserati Granturismo", wyscig, tankowanie)).start();
  19. new Thread(new Samochod("Bugatti Veyron", wyscig, tankowanie)).start();
  20. new Thread(new Samochod("Porsche Carrera GT", wyscig, tankowanie)).start();
  21.  
  22. System.out.println("Na miejsca...");
  23. Thread.sleep(2000);
  24. System.out.println("...gotowi...");
  25. Thread.sleep(2000);
  26. System.out.println("START! \n");
  27. wyscig.Start();
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement