

MCQOPTIONS
Saved Bookmarks
This section includes 3 Mcqs, each offering curated multiple-choice questions to sharpen your Object Oriented Programming Using C++ knowledge and support exam preparation. Choose a topic below to get started.
1. |
If all the members are defined in protected specifier then? (Constructors not considered) |
A. | Instance of class can t be created |
B. | Instance of class can be created anywhere |
C. | Instance of class can be created only in subclasses |
D. | Instance of class can be created only in main() function |
Answer» C. Instance of class can be created only in subclasses | |
2. |
Protected members differ from default members as _______ |
A. | Protected members can be accessed outside package using inheritance, but default can t |
B. | Default members can be accessed outside package using inheritance, but protected can t |
C. | Protected members are allowed for inheritance but Default members are not allowed |
D. | Both are same |
Answer» B. Default members can be accessed outside package using inheritance, but protected can t | |
3. |
If a constructor is defined in protected access, then? |
A. | It s instance can be created inside the subclasses |
B. | It s instance can be created anywhere in the program |
C. | It s instance can be created inside the subclasses and main() function |
D. | It s instance can be created inside the parent class only |
Answer» B. It s instance can be created anywhere in the program | |