Which Constructor Will Be Called From The Object Created In The #155
Which constructor will be called from the object created in the code below?</p> <pre><code class="language-cpp"> class A { int i; A() { i=0; cout<<i; } A(int x=0) { i=x; cout<<I; } }; A obj1; </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.1.
Which constructor will be called from the object created in the code below?
class A { int i; A() { i=0; cout<<i; } A(int x=0) { i=x; cout<<I; } }; A obj1;
Default constructor
Parameterized constructor
Compile time error
Run time error