I have a strange (and maybe silly) question: I was wondering…. why is java “Object” class called “Object”, not “Class”?
For example, for ArrayList whe have the following hierarchy
Object ->
Collection ->
List ->
ArrayList
Ok: ArrayList is a List… List is a Collection… but a Collection (the class of all collections) is not an Object… it is a class!
Think about what the object itself is. An
ArrayListis a list, yes? It’s also an object. It’s not a class of object. The class name describes what instances of that class represent.A collection isn’t a class of collections – it’s a collection (and it’s an object).