Why compiler is added default constructor in java class?
Answers
Answered by
0
purpose of adding defult constructor:
constructor's dulty is initialise instance variables, if there are no instance variables you could choose to remove constructor from your class. so,if there is no constructor,
java compiler add a defult constructor and calls super class constructor.
Hope its helpful for you.....
constructor's dulty is initialise instance variables, if there are no instance variables you could choose to remove constructor from your class. so,if there is no constructor,
java compiler add a defult constructor and calls super class constructor.
Hope its helpful for you.....
Answered by
0
hy
here is your answer
======================================================================
------When we do not explicitly provide a constructor to our class, the compiler provides a default constructor which initialises all the instance variables to their default --------
======================================================================
i hope you understand
here is your answer
======================================================================
------When we do not explicitly provide a constructor to our class, the compiler provides a default constructor which initialises all the instance variables to their default --------
======================================================================
i hope you understand
Similar questions