Objects and Classes

Q1: What happens when we try to compile the class definition in following code snippet?
class Birds {};
class Peacock : protected Birds {};

A It will compile succesfully.

B It will not compile because class body of Birds is not defined.

C It will not compile because a class cannot be protectedly inherited from other class.

D It will not compile because class body of Peacock is not defined.

ANS:A - It will not compile because class body of Birds is not defined.

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.