+ 2
Is Scanner considered an object ?
3 odpowiedzi
+ 9
it's a class when you are importing java.util.Scanner.
when you make an instance of it , then it's an object !
+ 2
Scanner is a class, just like any class you make. It is in standart java library in java.utill package. You can make an object out of every class unless it is abstract or anonymous (i cant think of any other exceptions, if there is any).
Scanner testName;
here, Scanner is the name of the class and testName is the name of the object. So with that, you made an object from Scanner class. If you continue and write
Scanner testName = new Scanner(exampleSource);
that would be an instance of the testName object.
+ 1
no