What’s the use of default constructor?
The default constructor is a constructor that gets called as soon as the object of a class is declared. The default constructor is un-parametrized. The generic use of default constructors is in the initialization of class variables.
class ABC{
int i,j;
ABC(){
i=0;
j=0;
}
}
Here ABC() is a default constructor.