Some related points:
1) The compiler will automatically insert a call to the no argument super class constructor in any constructor which does not contain an explicit call to the superclass constructor. (I encourage you to choose explicit behaviour over implicit behaviour when writing code, but this is a disputed point of style). At any rate to the compiler your code will look like:
class A{
public A() {
System.out.println(this.getClass().getName());
}
}
class B extends A{
public B() {
super();
System.out.println(this.getClass().getName());
}
}
class C extends B{
public C() {
super();
System.out.println(this.getClass().getName());
}
}
class Main{
public static void main(String[] args){
new C();
}
}
This makes it clear that the System.out.println is called three separate times.
2) The use of this inside a constructor to call methods on can generally lead to quite strange behaviour. See for example: this. That is because the initialisation works like this:
1) The class C constructor is called. At this point memory is allocated for a class C object and the objects meta data, including its class, interfaces implemented are filled out inside the VM. All fields, including inherited fields are initialised to their default value.
2) The class B constructor is called. Inside the constructor this refers to an object of class C, but none of the fields initialised in the C constructor will have been initialised yet. This will immediately call the class A constructor.
3) The class A constructor runs. Fields set in this constructor are initialised. The constructor executes methods and initialisations and returns and the stack passes back to the B constructor.
4) The B constructor executes its methods and returns control to the C constructor.
5) The C constructor returns.
So now we understand what happens: this chain prints C three times. I suspect that what you want is to write:
class A{
public A() {
System.out.println(A.class.getName());
}
}
class B extends A{
public B() {
super();
System.out.println(B.class.getName());
}
}
class C extends B{
public C() {
super();
System.out.println(C.class.getName());
}
}
class Main{
public static void main(String[] args){
new C();
}
}
which will print out A,B,C.