Outputting the input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Outputting the input

So instead of System.out.println(myvar.nextLine()); I can declare a string variable and equate to read the input?

7th Feb 2017, 2:41 AM
Sundus Yawar
Sundus Yawar - avatar
1 Answer
+ 2
Yep, you can assign Scanner.nextLine() to a String object to manipulate the input. Same goee for any nextN() data type.
7th Feb 2017, 2:56 AM
Blightedsage
Blightedsage - avatar