why do we have to call the super class constructors in order to use the instance variables and methods of sub class.Even if we want to use the instance variables inside the constructor of the sub class,we cannot do so unless we have the constructors of all the super classes run already.
Why is so?
Why is it necessary for the sub class to run the constructors of super classes to use its own instance variables inside its own constructor?
Joined: Oct 13, 2005
Because a sub-class-object IS A super-class-object. that is the basis of inheritance.A car which is a green Ford also IS-A vehicle which is a green Ford. So when you create your object as a green Ford car, you have to create it as a green Ford vehicle first.