class Oppgave implements Runnable{ private int id; public Oppgave(int id){ this.id = id; } @Override public void run(){ for(int i = 0; i < 5; i++){ try{ Thread.sleep(1000); } catch(InterruptedException e){ e.printStackTrace(); } System.out.println("Id " + id + ": " + i); } } }