this->x=x;
this->y=y;
what is the use of “this” keyword why is it used inside parameter constructor ?
is it necessray to create deafult constructor inside car class?
Problem related to this keyword and default constructor
@vikash3303
When the identifier names, i.e the names of the class variable and the parameters are same, this keyword is used so as to be able to distinguish between the two. It is not necessary to use it in the constructor. You can use it anywhere in the class, or if you wish to skip its use, change the name of the argument. You do not create a default constructor. You override the default one with the custom one you create.
I hope this was what you were looking for.
If my explanation was able to resolve your query, please mark the doubt as resolved.