why sir used an empty class() object in class car
Car sorting problem
hi @Kshubham1532 that is called a default constructor.
A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values. If no user-defined constructor exists for a class A and one is needed, the compiler implicitly declares a default parameterless constructor.
But if a user-defined constructor exists, then a default constructor also needs to be declared explicitly. It is done to avoid errors if no parameters are passed during object creation.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.