I have been learning constructors in Inheritance using Eclipse Juno.
When I press ctrl+O twice in the childClass, It shows inherited members. But I happen to see even the Constructor of super class in the inherited members
But it is said that constructors are not inherited...
Can someone please explain this behaviour?
Unlike fields, methods, and nested classes ,Constructors are not class members.
From docs of Inheritance
A subclass inherits all the members (fields, methods, and nested classes) from its superclass. Constructors are not members, so they are not inherited by subclasses, but the constructor of the superclass can be invoked from the subclass.
But why constructor removed from class member ??
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With