import java.util.Scanner; class Bombe implements Runnable{ Kode kode; int tid = 5; public Bombe(Kode k){ System.out.println("Legg inn armeringskode: "); k.addCode(new Scanner(System.in).nextLine()); } @Override public void run(){ while(tid > 0){ tid--; try { Thread.sleep(1000); } catch (InterruptedException e) { System.out.println("Bomben ble avbrutt"); return; } } System.out.println("Boom!"); System.exit(0); } }