import java.util.ArrayList; import java.util.Scanner; import java.util.HashMap; import java.io.File; class Hovedprogram{ public static void main(String[] args) { Monitor monitor = new Monitor(3); String[] alleFilnavn = {"data/person1.csv", "data/person3.csv", "data/person2.csv"}; for(String filnavn : alleFilnavn){ new Thread(new Filleser(new File(filnavn), monitor)).start(); } ArrayList alleTraader = new ArrayList<>(); for(int i = 0; i < 10; i++){ Thread traad = new Thread(new FinnAlleSyke(monitor)); traad.start(); alleTraader.add(traad); } for(Thread traad : alleTraader){ try{ traad.join(); }catch(Exception e){ } } System.out.println("Her! " + monitor.hentAlleSyke()); } }