+ 2

Is Scanner considered an object ?

15th Sep 2018, 11:41 PM
Alexis C. Student
Alexis C. Student - avatar
3 Answers
+ 9
it's a class when you are importing java.util.Scanner. when you make an instance of it , then it's an object !
15th Sep 2018, 11:45 PM
Michael
Michael - avatar
+ 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.
20th Sep 2018, 9:35 AM
Shadowa
Shadowa - avatar
+ 1
no
17th Sep 2018, 12:24 PM
jyothirmai buram