import java.util.Scanner; class Desarmer implements Runnable{ Kode k; Scanner sc = new Scanner(System.in); public Desarmer(Kode k){ this.k = k; } @Override public void run(){ System.out.println("Skriv: " + k.getCode() + " for aa deaktivere bomben. Du har 5 sekunder!"); String inn = sc.nextLine(); while( !k.compareCode(inn)){ System.out.println("Feil kode"); inn = sc.nextLine(); } System.out.println("Phew!!!!"); } }