for (int i = 1; i <= value; i++) {
System.out.print("Player " + i + ", Please Enter your name : ");
String PlayerName = input.nextLine();
System.out.print("Please enter a number between 0 and 9 : ");
int PlayerNumber = input.nextInt();
System.out.println(PlayerName + " : " + PlayerNumber);
}
Output : Player 1, Please Enter your name : Please enter a number between 0 and 9 :
If I change input.nextLine
to input.next
, it will wait for the users first input but he/she won't be able to write their full name.
My question : What can I change so the user can input his full name first and then his number?