learning jave



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

1 Answer(s)


0

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.

Thanks,