i need to get clear about, the best way to call the super class constructor/method explicitly.
I tried with the following both way to call superclass constructor:
Myclass::Myclass(int a, int b):X(a),Y(b)
{
// do something
}
and
Myclass::Myclass(int a, int b)
{
X = a;
Y = b;
}
So my question over here is:
- Which is the best way to call super class constructor/method explicitly?
- And what are the benefits will get in both way?
- what is the best practice and why?
- There is any performance issue lies with both way?
Regarding my question i found this link: What are the rules for calling the superclass constructor? but still i have little more doubt what i asked above.
if there is any online tutorial, blog or video also u can mention over here, it will great help full for me. Thank in advance.....