Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to stop scanner object skipping

System.out.print("Insert a number: ");
int number = input.nextInt();
input.nextLine(); // This line you have to add (It consumes the 
 character)
System.out.print("Text1: ");
String text1 = input.nextLine();
System.out.print("Text2: ");
String text2 = input.nextLine();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #stop #scanner #object #skipping
ADD COMMENT
Topic
Name
5+1 =