Question: Example 3 : Inheritance = Consider the following C + + class definition: public class AClass { private: int x , y ; public: Aclass

Example 3: Inheritance
= Consider the following C++ class definition:
public class AClass{
private:
int x,y;
public:
Aclass (int a, int b) : x(a), y(b){}
int addEm() i
return x+y;
}
...
}
You want to derive a subclass from AClass called BClass. BClass will have a third int instance data, z. Which of the following would define BClass's constructor?
a. BClass (int a, int b, int c): AClass (a, b), z (c) f
b. BClass (int a, int b, int c)(x=a;y=b;z=c; }
c. BClass (int a, int b, int cz=C;
AClass (a, b) ; }
d. BClass(int a, int b, int c) : z(c)1
AClass (a, b) ; }
 Example 3: Inheritance = Consider the following C++ class definition: public

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!