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