Which Among The Following Is Correct For The Code Given Belowp #224
Which among the following is correct for the code given below?</p> <pre><code class="language-cpp"> class A { private : A() { } public : A(int x) { } }; A a; A b(100); </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 OOps Access Specifiers - OOPs MCQ: Private Access Specifier - Quiz No.2.
Which among the following is correct for the code given below?
class A { private : A() { } public : A(int x) { } }; A a; A b(100);
Program will give compile time error
Program will run fine
Program will give runtime error
Program will give logical error