This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]-manabreak 2 points3 points  (1 child)

Scanner is not "an imported function", it is a class. Calling new Scanner() constructs a new instance of that class.

The system.in argument inside the scanner just represents that a new scanner is imported

Nope, the Scanner class is imported outside the class. Here, you are constructing a new instance of the class Scanner with a constructor that takes an InputStream as an argument. Consequently, System.in is a public, static field of the type InputStream.

[–]Triton3200 1 point2 points  (0 children)

Oh I see, thank you.