import java.util.Scanner; public class Bombe implements Runnable { private Kode code; private Scanner input = new Scanner(System.in); private int timeLeft = 10; public Bombe(Kode c) { code = c; System.out.println("Oppgi kode for aa armere bomben: "); code.addCode(input.nextLine()); } @Override public void run() { while (timeLeft > 0) { System.out.println("Time remaining: " + timeLeft); timeLeft--; try { Thread.sleep(1000); } catch (InterruptedException e) { return; } } System.out.println("BOOM!"); System.exit(0); } }