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();".
how to get a string from the user ?
You must be signed in to leave a comment
3 September 2018, 08:06
class Scanner does not have nextString() method, you can use the nextLine() method.