> The only exception is when the parent class have an empty constructor.
If you do not supply a call to another constructor of the same class or a construtor of the parent class as the first statement of your constructor, an implicit call to the super class's default (no-arg) constructor is inserted by the compiler. Now if that implicitly invoked constructor does not exist or is not accessible, it is a compile-time error situation.
Check the following sample:
public class B{
public B(){
System.out.println("B");
}
}
public class A extends B{
public A(){
System.out.println("A");
}
}
public class Test{
public static void main(String[] args){
A a = new A();
}
}
result:
B
A
surprised?
Meanwhile I realized that a constructor in the parent class
and child class is always called, be it implicitly as default
constructor or explicitly as default constructor or other
constructor.
"Meaningful state" - good point. I think my main concerns
go in that direction. On the one hand it's my task to
choose an appropriate super constructor and on the other
hand it's the task of the superclass developer to only offer
constructors which set the class in a meaningful state.
If there are several constructors to choose from, you
can't but know the behaviour of the superclass.