C++ Programming - Objects and Classes

Exercise : Objects and Classes - General Questions
6.
Which of the following statements is correct when a class is inherited publicly?
Public members of the base class become protected members of derived class.
Public members of the base class become private members of derived class.
Private members of the base class become protected members of derived class.
Public members of the base class become public members of derived class.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

7.
Which of the following statements is correct about the constructors and destructors?
Destructors can take arguments but constructors cannot.
Constructors can take arguments but destructors cannot.
Destructors can be overloaded but constructors cannot be overloaded.
Constructors and destructors can both return a value.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

8.
Which of the following access specifies is used in a class definition by default?
Protected
Public
Private
Friend
Answer: Option
Explanation:
No answer description is available. Let's discuss.

9.
Which of the following statement is correct with respect to the use of friend keyword inside a class?
A private data member can be declared as a friend.
A class may be declared as a friend.
An object may be declared as a friend.
We can use friend keyword as a class name.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

10.
Which of the following keywords is used to control access to a class member?
Default
Break
Protected
Asm
Answer: Option
Explanation:
No answer description is available. Let's discuss.