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