Hi ranchers,
In k&b p139 I have been reading that a constructor can never have a call to super() and a call to this() because either needs to be the first statement in a constructor.
Also it has been stated that -
'That also means the compiler will not put a call to super() in any constructor that has a call to this()'
But I am not able to verify this. e.g. if I run the following code -
I get the following output -
In Super constructor...
In SuperTest no-args constructor...
In Super constructor...
In SuperTest no-args constructor...
In SuperTest(
String s) constructor...
It looks like the compiler Is putting a call to super() even when the constructor SuperTest(String s) has a call to this().
Could somebody please explain if I am doing something wrong here?