What is the output of following program?
(A) x = garbage value y = garbage value
(B) x = 0 y = 0
(C) Compiler Error
Explanation: There is compiler error in line “Point p1;”. The class Point doesn’t have a constructor without any parameter. If we write any constructor, then compiler doesn’t create the default constructor.
It is not true other way, i.e., if we write a default or parameterized constructor, then compiler creates a copy constructor. See the next question.
Quiz of this Question