Discussion :: Constructors and Destructors
-
Which of the following statement is correct about the program given below?
#include class FresherGate { int x; public: FresherGate() { x = 0; } FresherGate(int xx) { x = xx; } FresherGate(FresherGate &objB) { x = objB.x; } void Display() { cout" "; } }; int main() { FresherGate objA(25); FresherGate objB(objA); FresherGate objC = objA; objA.Display(); objB.Display(); objC.Display(); return 0; }
|
A.
The program will print the output 25 25 25 . |
|
B.
The program will print the output 25 Garbage 25 . |
|
C.
The program will print the output Garbage 25 25 . |
|
D.
The program will report compile time error. |
Answer : Option A
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook