import java.util.Scanner; class Disarm implements Runnable{ Kode k; Scanner sc; public Disarm(Kode k) { this.k = k; } @Override public void run() { sc = new Scanner(System.in); System.out.println("Skriv inn koden for ? deaktivere bomben:"); String inn = sc.nextLine(); while (!k.compareKode(inn)) { System.out.println("feil kode"); inn = sc.nextLine(); } System.out.println("Bomben er desarmert!"); sc.close(); } }