My while loop does not go to my next user input "y1".. it just loops back. user input "y" works, i give a value, it calculates, waits the 2000 ms and then loops. Any ideas? Sorry for the messy code, still learning.
if (x1.equalsIgnoreCase("JA")) {
while (true) {
System.out.println("Hvad er beløbet?");
double y = scanner.nextDouble();
System.out.println(y * 6.6296);
wait(2000);
System.out.println("Vil du indtaste et nyt beløb?");
String y1 = scanner.nextLine();
if (y1.equalsIgnoreCase("JA")) {
}
if (y1.equalsIgnoreCase("NEJ")) {
break;
}
}
}