Scanner myvar = new Scanner (System.in) Why is this used. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Scanner myvar = new Scanner (System.in) Why is this used.

The value is assigned from this statement:- Var=myvar.nextLine()

16th Dec 2016, 1:54 PM
Rohit thapliyal
Rohit thapliyal - avatar
1 Answer
0
it is used to get the inputs in java it works similar to scanf in C and cin in C++
16th Dec 2016, 3:20 PM
Vijeth Belle
Vijeth Belle - avatar