+ 3
what is the use of default constructor in JAVA?
3 Answers
+ 10
... To initialize class members when given no arguments? Is there anything in particular that you do not understand from that?
+ 4
Constructor as the name implies it is useful to construct the object. As we know object is nothing but an entity which has its own states and behavior meaning that it has its own data member and function member. So, here "construct the object" in turn it means that constructing the data members of the object you create.
Default constructor is something which is useful to initialize the data members (Variables) to their default value when you create any object.
+ 1
it initilize the value of member variable