1-844-696-6465 (US)        +91 77600 44484        help@dezyre.com

learning jave

getting user input under flow control statment have some problem understanding the concept with the scanner input and scanner.in

1 Answer(s)


Hi Josephine,

Scanner is a class available in java.util package used to read input from the console.

For example -

Scanner scn = new Scanner(System.in); 

Where Scanner is a class name, scn is object name. Scanner() is constructor who took "System.in" as parameter.

System is class name available in java.lang package and in is a variable name.

"in" is object of InputStream class.

Hope this helps.



Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)