0
What is the difference between subclass and object? Is subclass also an object of the class?
Is all objects are the subclass of a superclass
3 Antworten
+ 7
Object is an instance of a class. You can treat class definition as an instruction how the objects of this class are created, what variables and methods they hold and what they do. Subclasses inheriting from this class are simply modified instructions on how a slightly different type of objects are created.
Themselves, subclasses are NOT instances of the superclass.
0
Is subclass also does not hold any info?
- 1
Classes do not hold any information, while an object does.