publicstaticvoidmain(String[] args){ Semaphore maxNum = new Semaphore(4); Semaphore[] fork = new Semaphore[5]; for (int i = 0; i < 5; i++) { fork[i] = new Semaphore(1); } Philosopher[] philosophers = new Philosopher[5]; for (int i = 0; i < 5;i++){ philosophers[i] = new Philosopher(i,maxNum,fork); } for(Philosopher i:philosophers){ i.start(); } } }