Which Option Is False For The Following Codep Pre Langcpp #218
Which option is false for the following code?</p> <pre><code class="language-cpp"> class A { private : int sum(int x, int y) { return x+y; } public: A() { } A(int x, int y) { cout<<sum(x,y); } }; </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.1.
Which option is false for the following code?
class A { private : int sum(int x, int y) { return x+y; } public: A() { } A(int x, int y) { cout<<sum(x,y); } };
Constructor can be created with zero argument
Constructor prints sum, if two parameters are passed with object creation
Constructor will give error if float values are passed
Constructor will take 0 as default value of parameters if not passed