To get interger from the user we use "new Scanner(System.in).nextInt();". in the simiral way can we write "new Scanner(System.in).nextString();".
herish surendran
Level 3
how to get a string from the user ?
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Roman
3 September 2018, 08:06
class Scanner does not have nextString() method, you can use the nextLine() method.
0