In a class there will be a constructor.If a programmer defines that then definitely it will have a body. But if we don’t define it then will that constructor will have a default body in it?
In a class there will be a constructor.If a programmer defines that then definitely
Share
If you leave the implementation of the default constructor to the compiler (which is what happens if you don’t define it) then the constructor will initialize all fields to their default values
E.g.
will from a functional point of view have the same default constructor