Which Casting Among The Following Is Allowed For The Code Given #1222

Which casting among the following is allowed for the code given below?</p> <pre><code class="language-cpp"> class A { public :int a; } class B:public A { int b; } main() { B b=new A(); //casting 1 A a=new B(); //casting 2 } </code></pre>

Online Quiz 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 Default Arguments vs Overloading, Upcasting and Downcasting - OOPs MCQ: Upcasting - Quiz No.1.


Similar question(s) are as followings:



Online Quizzes of gs111 OOP Object Oriented Programming Java

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background