Ste Davies wrote:Hi All, I understood that if you put the keyword 'this' in a constructor the compiler doesn't insert super().
But this code still calls Alpha even though it has a 'this' in the Beta constructor
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
Ste Davies wrote:Thanks guys.
Ste Davies wrote:Kevin: So its this() which excludes super() not this.something ?
Ste Davies wrote:Well I did this:
and got:
Alpha constructor
Beta string constructor
Beta constructor
Its still the same.
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
Ste Davies wrote:
Alpha constructor
Beta string constructor
Beta constructor
Its still the same.
Kevin Workman wrote:
If you still don't understand what's going on, I'd suggest stepping through the program with a debugger so you can see what's happening line by line.
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook