Which Constructor Will Be Called From The Object Obj2 In The #162
Which constructor will be called from the object obj2 in the following program?</p> <pre><code class="language-cpp"> class A { int i; A() { i=0; } A(int x) { i=x+1; } A(int y, int x) { i=x+y; } }; A obj1(10); A obj2(10,20); A obj3; </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs111 OOP Object Oriented Programming Java. It can also be found in gs gs111 Constructors and Destructors - OOPs MCQ: Overloading Constructors - Quiz No.2.
Which constructor will be called from the object obj2 in the following program?
class A { int i; A() { i=0; } A(int x) { i=x+1; } A(int y, int x) { i=x+y; } }; A obj1(10); A obj2(10,20); A obj3;
A(int x)
A(int y)
A(int y, int x)
A(int y; int x)