Alejandro_S_Mercado

Untitled

Sep 24th, 2025
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public class MainZoo {
  2.  
  3.     public static void main(String[] args) {
  4.        
  5.         Pasillo pasillo = new Pasillo();
  6.         Random random = new Random();
  7.         int id = 1;
  8.  
  9.         while (true) {
  10.             Persona p = new Persona(id++, pasillo);
  11.             p.start();
  12.  
  13.             try {
  14.                 int arrivalTime=random.nextInt(101) + 100;
  15.                 Thread.sleep(arrivalTime);
  16.             } catch (InterruptedException e) {
  17.                 e.printStackTrace();
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment