Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab05;
- /*
- * G��wna klasa kt�ra przeprowadza wielow�tkowy wy�cig
- */
- public class Main {
- public static void main(String[] args) throws InterruptedException {
- //tworzymy wy�cig oraz stacj� paliw
- Wyscig wyscig = new Wyscig();
- Tankowanie tankowanie = new Tankowanie();
- //tworzym samochody - w�tki
- new Thread(new Samochod("Ferrari F430", wyscig, tankowanie)).start();
- new Thread(new Samochod("Mercedes AMG GT", wyscig, tankowanie)).start();
- new Thread(new Samochod("Maserati Granturismo", wyscig, tankowanie)).start();
- new Thread(new Samochod("Bugatti Veyron", wyscig, tankowanie)).start();
- new Thread(new Samochod("Porsche Carrera GT", wyscig, tankowanie)).start();
- System.out.println("Na miejsca...");
- Thread.sleep(2000);
- System.out.println("...gotowi...");
- Thread.sleep(2000);
- System.out.println("START! \n");
- wyscig.Start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement