********Will Constructor Participate in Inheritance??********
some told me it does.some told me it dont.
which is correct..pls help
Loading
********Will Constructor Participate in Inheritance??********
some told me it does.some told me it dont.
which is correct..pls help
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Uday DodiyaPosted Oct 4, 2022, 12:12 PM
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.
For More Visit this https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html#:~:text=Constructors%20are%20not%20members%2C%20so,be%20invoked%20from%20the%20subclass.
Ismail SayyadPosted Oct 4, 2022, 12:03 PM
Hello Jaya Prakash,
Construction cannot be inherited since the subclasses has different class name
For eg.