Programming - C++ Language
You Are Here :: Home > C++ Language > Oops - General Questions
1. |
When you derive a class privately, a protected base class member becomes
|
A. |
private |
B.
|
public |
C.
|
not inherited
|
D.
|
protected
|
|
Answer: Option A
Explanation:
|
2. |
Irrespective of type of derivation__________members of a base class are never accessible in derived class.
|
A. |
(b), (d) and (e) |
B.
|
private |
C.
|
none of these
|
D.
|
protected
|
|
Answer: Option B
Explanation:
|
3. |
Which of the following statements is correct?
|
A. |
First time method of a class is called, the constructor method is called. |
B.
|
Every time method of a class is called, the constructor method is called. |
C.
|
Every time an instance of a class is created, the constructor method is called.
|
D.
|
None of the above
|
|
Answer: Option C
Explanation:
|
4. |
Member of a class specified as _______ are accessible only to method of the class.
|
A. |
private |
B.
|
public |
C.
|
protected
|
D.
|
derive
|
|
Answer: Option A
Explanation:
|
5. |
The Object is not declared for which class?
|
A. |
Parent |
B.
|
Base |
C.
|
Abstract
|
D.
|
Derived
|
|
Answer: Option C
Explanation:
|
6. |
When a copy of an entire object is passed to a function, then it is referred to as
|
A. |
Pass-by-reference |
B.
|
Pass-by-pointer |
C.
|
Pass-by-value
|
D.
|
None of the above
|
|
Answer: Option C
Explanation:
|
next »