0
How to create scanner for string?
2 Answers
+ 3
next() if you want to use a delimiter
nextLine() if you want input until end of line (line break \n)
+ 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.