#Inheritance
7 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @charred drum! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
.... By design, the purpose of a constructor is to properly construct the objects and rely on the fact that after the constructor is called, it is properly constructed.
Which means that without calling the constructor this is not ensured. So this is not acceptable. To avoid this unacceptable situation, the constructor is always called when constructed an instance. That includes when constructing the instance of a subclass whose superclass has a constructor.
so we want to just make sure that the superclass has been set up correctly before using it's properties / methods in the child class constructor. Is this the right way to put it?
yup
Order of Execution of Constructors in Java Inheritance with java tutorial, features, history, variables, object, programs, operators, oops concept, array, string, map, math, methods, examples etc.