Which Among Following Is Correct For Initializing The Class #44
Which among following is correct for initializing the class below?</p> <pre><code class="language-cpp"> class student{ int marks; int cgpa; public: student(int i, int j){ marks=I; cgpa=j } }; </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 Concept & Features - OOPs MCQ: Objects - Quiz No.2.
Which among following is correct for initializing the class below?
class student{ int marks; int cgpa; public: student(int i, int j){ marks=I; cgpa=j } };
student s[3]={ s(394, 9); s(394, 9); s(394,9); };
student s[2]={ s(394,9), s(222,5) };
student s[2]={ s1(392,9), s2(222,5) };
student s[2]={ s[392,9], s2[222,5] };