What is difference between thse two constructers

I have a base class and child class, particularly in the child class custom constructors happen if we call super.new() what happens if we don’t call super.new() in the child class constructor, does it make any difference?

I suggest using the terms base and derived class, not parent and child. With inheritance, you only custruct one object.

If you don’t call super.new() as the first line in your derived constructor, that call gets automatically inserted.
You should look at my course on OOP, especially the second section on inheritance.

1 Like