How to create scanner for string?

16th Dec 2019, 6:10 AM
Syahir Coolz
Syahir Coolz - avatar
2 Answers
+ 3
next() if you want to use a delimiter nextLine() if you want input until end of line (line break \n)
16th Dec 2019, 6:15 AM
「HAPPY TO HELP」 - avatar
+ 4
But always remember that if we take a String input after an integer input, the String input is just skipped and moves to the next input. So to avoid this we have to again define the nextLine() function. But in BufferedReader there is no such problem.
16th Dec 2019, 6:37 AM
Smriti Kaur
Smriti Kaur - avatar