Choose The Correct Option For The Following Codep Pre Langcpp #122
Choose the correct option for the following code.</p> <pre><code class="language-cpp"> class student { int marks; } student s1; student s2=2; </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: Types of Constructors - Quiz No.1.
Choose the correct option for the following code.
class student { int marks; } student s1; student s2=2;
Object s1 should be passed with argument
Object s2 should not be declared
Object s2 will not be created, but program runs
Program gives compile time error