1. The default, no-arg constructor is ONLY provided if you do not provide a constructor.
2. If you provide a constructor but also wish to have a no-arg constructor, you MUST define it yourself.
3. When a subclass is instantiated, the superclass of that class must be instantiated prior to the class being instantiated. This is done by invoking the superclass' constructor from the subclass constructor. This happens every time. If you do not explicitly invoke the superclass constructor, the compiler does it for you. Here's an example (untested):
As you can see, the Parent class constructor was invoked
implicitly. As we did not explicitly invoke the superclass' constructor in the subclass' constructor, the compiler automatically inserted an invocation. Which superclass constructor does it invoke implicitly?
The no-arg one! That's why, if you don't have a no-arg constructor in your superclass, you
MUST invoke the proper superclass constructor explicity from the subclass constructor. Here's another example:
As you can see, I successfully extended Parent
without having a default constructor. In such a case, all subclasses are required to explicity invoke the proper superclass constructor because the implicit one that the compiler inserts (the no-arg one) doesn't exist.
Check out this section of the JLS:
§8.8.5 Constructor Body