import java.util.Scanner; public class Desarmer implements Runnable { private Scanner input = new Scanner(System.in); private Kode code; public Desarmer(Kode c) { code = c; } @Override public void run() { System.out.println("Tast inn riktig kode for aa desarmere bomben: "); String inntastetKode = input.nextLine(); while (! code.checkCode(inntastetKode)) { System.out.println("Feil kode, proev igjen: "); inntastetKode = input.nextLine(); } System.out.println("Phew :) "); } }