0

System.out.println(myVar.nextLine());

why we used myvar.nextline()here

29th Aug 2018, 4:35 PM
Krutika
Krutika - avatar
1 Answer
+ 1
nextLine() reads an input and converts it to String myVar is the scanner's name - previously it has to be declared as: Scanner myVar = new Scanner(); Since this function is used as a println's argument, the input gets printed out immediately after it is read.
29th Aug 2018, 4:44 PM
Steppenwolf
Steppenwolf - avatar