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

Whatsapp
Facebook