INHERITANCE IN C++ (12)

Consider the following declaration and answer the questions(i) to (iv):

class Mydata
{
protected:
int Data;
public:
void getMydata(int);
void ManipData(int);
void ShowData(int);
};

class Mydata1
{
protected:
int Data1;
public:
void getMydata1(int);
void ShowData1(int);
};

class Person:public Mydata, Mydata1
{
public:
void ShowData(void);
};

(i) Which type of inheritance is depicted in the above class definition>
I. Single Level Inheritance
        II. Multi Level Inheritance
III. Multiple Inheritance
(ii) List the data and function inherited by the class Person.
(iii) What will be the size of an object (in bytes) of class Mydata1?
(iv) Name the data members that can be accessed from function ShowData1(int).


No comments

Post your comments

Powered by Blogger.