Here in the main() method, new House("x ") calls its constructor House(String name).
A constructor can either have a call to this() or super() (but not both).
Here in the constructor this() is explicitly defined, so does the compiler still insert super() to initialize it's base class??
Or how else it's done, please clarify. And suggest some good links to understand these topics properly.
I'll probably butcher this explanation but nobody else is taking it so here goes…
Yeah. House's overloaded String constructor calls it's own no-arg constructor, which calls it's superclass's no-arg constructor. (Super's String constructor never gets called of course.)
S & B says "The first statement of every constructor must be a call to this() (an overloaded constructor) or super()." and also "The compiler will add a call to super() unless you have already put in a call to this() or super()." So I take that to mean that each overloaded constructor gets the compiler-added call. Even if one of the OTHER constructors already had a call to to super or this, like in this case.
When the program start, it calls the main method and does "new House("x");
new House("x") call the constructor House(String name).
During the compilation, House(String name) saw the keyword "this" ... so it didn't add a super() keyword. If it's not the case, It add a super() keyword without ARGS !
The constructor House(String name) calls House() without arg ! And this constructor, because you didn't put a keyword at the beginning, add the super() keyword. And the super keyword refer to superclass Building() (which refer to superclass constructor of Object()).