MCQ On Inheritance - C++ Programming

25. What will be the output of the following program?
Note:Includes all required header files

class find {
public:
void print() { cout <<" In find"; }
};
class course : public find {
public:
void print() { cout <<" In course"; }
};
class tech: public course { };
int main(void)

{
tech t;
t.print();
return 0;
}

A. In find
B. In course
C. Compiler Error: Ambiguous call to print()
D. None of the above

View Answer


26.Which symbol is used to create multiple inheritance?

A. Dot
B. Comma
C. Dollar
D. None of the above

View Answer


27.……………….. inheritance may lead to duplication of inherited members from a ‘grandparent’ base class.

A. Multipath
B. Multiple
C. Multilevel
D. Hierarchical

View Answer


28.C++ Inheritance relationship is?

A. Association
B. Is-A
C. Has-A
D. None of the above

View Answer


29.Private members of the class are not inheritable.

A. True
B. False

View Answer






Also check :


Discussion


* You must be logged in to add comment.