I don’t understand what Scanner in = new means. Why is this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I don’t understand what Scanner in = new means. Why is this?

I don’t understand what Scanner in = new means. Why is this?

8th Aug 2019, 11:03 AM
Михаил Попов
Михаил Попов - avatar
3 Answers
+ 5
It use to to get input from a person who are work with this program
8th Aug 2019, 11:26 AM
Saeed
+ 3
Scanner is a class which you import with import java.util.Scanner; it is used to get user input. Scanner sc = new Scanner(System.in); this line of code generates a scanner object named "sc". using this object you can now request input like this(, but there are many diffrent ways to get input using a Scanner): String input = sc.next();
8th Aug 2019, 11:29 AM
Anton Böhler
Anton Böhler - avatar
+ 1
Scanner can scan stream of some data, eg user input from keyboard
8th Aug 2019, 1:06 PM
zemiak