Question: Considering the following implementation, what is the missing line? class Test { private: int x; int y; public: Test (int x = 0, int
Considering the following implementation, what is the missing line? class Test { private: int x; int y; public: Test (int x = 0, int y = 0) { this->x = x; this->y = y; } Test* setX(int a) { x = a; return this; } Test setY(int b) { y = b; return this; } void print() { cout < < "x = " < < x < < y " }; int main() } Test obj1(5, 5); // MISSING LINE obj1.print(); return 0; < < y < < endl; }
Step by Step Solution
There are 3 Steps involved in it
The missing line in the code should be a call to the setX or setY member functions o... View full answer
Get step-by-step solutions from verified subject matter experts
