public class Hovedprogram{ public static void main (String[] args){ final int antallBaristaer = 2; final int antallKopperPerBarista = 10; final int antallKaffedrikkere = 10; Bord bord = new Bord(antallBaristaer * antallKopperPerBarista); Thread[] baristaer = new Thread[antallBaristaer]; for (int i = 0; i < antallBaristaer; i++){ baristaer[i] = new Thread(new Barista(bord, i + 1, antallKopperPerBarista)); } Thread[] kaffedrikkere = new Thread[antallKaffedrikkere]; for (int i = 0; i < antallKaffedrikkere; i++){ kaffedrikkere[i] = new Thread(new Kaffedrikker(bord, i + 1)); } for (Thread barista : baristaer){ barista.start(); } for (Thread kaffedrikker : kaffedrikkere){ kaffedrikker.start(); } } }