C++ Programming - Objects and Classes
|
|
|
|
Exercise"Time and tide wait for none."
- Alexander Pope
|
| 6. |
Which of the following statements is correct when a class is inherited publicly? |
| A. |
Public members of the base class become protected members of derived class. | | B. |
Public members of the base class become private members of derived class. | | C. |
Private members of the base class become protected members of derived class. | | D. |
Public members of the base class become public members of derived class. |
Answer: Option B
Explanation:
No answer description available for this question. Let us discuss.
|
| 7. |
Which of the following statements is correct about the constructors and destructors? |
| A. |
Destructors can take arguments but constructors cannot. | | B. |
Constructors can take arguments but destructors cannot. | | C. |
Destructors can be overloaded but constructors cannot be overloaded. | | D. |
Constructors and destructors can both return a value. |
Answer: Option C
Explanation:
No answer description available for this question. Let us discuss.
|
| 8. |
Which of the following access specifies is used in a class definition by default? |
| A. |
Protected | B. |
Public | | C. |
Private | D. |
Friend |
Answer: Option E
Explanation:
No answer description available for this question. Let us discuss.
|
| 9. |
Which of the following statement is correct with respect to the use of friend keyword inside a class? |
| A. |
A private data member can be declared as a friend. | | B. |
A class may be declared as a friend. | | C. |
An object may be declared as a friend. | | D. |
We can use friend keyword as a class name. |
Answer: Option D
Explanation:
No answer description available for this question. Let us discuss.
|
| 10. |
Which of the following keywords is used to control access to a class member? |
Answer: Option A
Explanation:
No answer description available for this question. Let us discuss.
|
|
|