jfcmacro

Jardin Ornamental con Interface ISync

Mar 28th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. public class JardinOrnamental {
  2.  
  3.     public static void main(String args[]) {
  4.  
  5.     ISync jardin = null;
  6.     if (args.length == 0)
  7.         jardin = new Jardin();
  8.     else
  9.         jardin = new JardinLimitado();
  10.  
  11.     Thread tAdmin = new Thread(new Admin(jardin));
  12.     tAdmin.start();
  13.    
  14.     for (int i = 0; i < 20; ++i) {
  15.         Thread t = new Thread(new Gente(jardin));
  16.         t.start();
  17.     }
  18.     try {
  19.         tAdmin.join();
  20.  
  21.     }
  22.     catch(InterruptedException ie) { }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment