import java.util.Scanner; class Bombe implements Runnable{ final int TID = 5; public Bombe(Kode k) { System.out.println("Legg inn kode: "); Scanner sc = new Scanner(System.in); k.addKode(sc.nextLine()); } @Override public void run() { int tid = 0; while (tid != TID) { tid++; try { Thread.sleep(1000); } catch (Exception e) { System.out.println("Bomben ble stoppet"); return; } } System.out.println("Boom"); System.exit(0); } }