Which Classset Of Classes Can Illustrate Polymorphism In The #65
Which class/set of classes can illustrate polymorphism in the following code?</p> <pre><code class="language-cpp"> abstract class student { public : int marks; calc_grade(); } class topper:public student { public : calc_grade() { return 10; } }; class average:public student { public : calc_grade() { return 20; } }; class failed{ int marks; }; </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: Polymorphism - Quiz No.1.
Which class/set of classes can illustrate polymorphism in the following code?
abstract class student { public : int marks; calc_grade(); } class topper:public student { public : calc_grade() { return 10; } }; class average:public student { public : calc_grade() { return 20; } }; class failed{ int marks; };
Only class student can show polymorphism
Only class student and topper together can show polymorphism
All class student, topper and average together can show polymorphism
Class failed should also inherit class student for this code to work for polymorphism