next line java does not take input
System.out.print("X: "); scanner.nextLine(); //throw away the \n not consumed by nextInt() x = scanner.nextLine(); System.out.print("Y: "); y = scanner.nextLine();
Source: stackoverflow.com