Thanks for the reply Ernest.
What is the actual point of having to construct an object of the superclass? I have all the methods I want in the subclass since they were inherited, and the variables as well..why instantiate another object in the superclass?
Would it be wise to just make a default empty constructor in the superclass everytime, and let the implicit super() construction that entails me not explicitly using a constructor for the superclass take over?
for example:
And then when I use extends
Or is the only point of this to be able to reuse the constructor and save you from typing out the initializations again, since that's basically what I just did.
Sorry for such a specific and trivial question, but I not only want to know how it works but why it works. Could you also please expound a bit more on your previous response, because I'm still a bit confused.
Every constructor, as the very first statement in its body, calls either another constructor from the same class, or a constructor from the superclass (the sole exception to this rule is the constructor java.lang.Object.Object(), which has no superclass constructor to call.)
Do you mean that every time I instantiate an object, the constructor in that object, calls the constructor in the class (which is the same constructor) ?
When you mention superclass, does this mean that even if I make one class, it still calls a constructor from the java.lang.Object class?
Thanks for the help man, I just want to be crystal clear on this.