That's how inheritance works : You only create an object which inherits the properties from the parents ones. So you create a single object, which has the same properties that takes from the Object
class and the ones that are into the custom class.
For example, you have both Person
and Student
classes, both extending from Object
. Student class also extends the Person
one. Person
has its properties, as name, surnames.. Appart from that Student
class has its own properties, as college code, average marks..
When you create a Student
a single Student
is created, with Object
's and Person
's properties.
Object
--Person (name, surname1, surname2)
--Student (college number, average mark)
You can have a look to English Wikipedia's Inheritance (object-oriented-programming) article, to know more about the inheritance, not only in Java language.