i dont find a solution to this problem. The first scan.nextLine() doesnt wait for input. It prints out "Deutsch: English:" an then waits for input. How do i stop the scanner from printing the second System.out.print ?
What i've found while searching for solutions was, to add a scan.nextLine() after "array.add(vk1)". That didnt work. Also i tried using two Scanners, that didnt work too.
If i use just scan.next() it works well, but i want to scan words like "to run" which has whitespace.
greetings
while(a){
System.out.println("1. Vokabel eingeben\n"+"2. Beenden");
java.util.Scanner scan = new java.util.Scanner(System.in);
int b = scan.nextInt();
if (b == 1){
System.out.print("Deutsch: ");
String vk1 = scan.nextLine();
array.add(vk1);
System.out.print("English: ");
String vk2 = scan.nextLine();
array.add(vk2);
}