adplus-dvertising
frame-decoration

Question

Which feature of OOP is indicated by the following code?
class student{  int marks;  };
class topper:public student{  int age;  topper(int age){   this.age=age;  }   };

a.

Inheritance

b.

Polymorphism

c.

Inheritance and polymorphism

d.

Encapsulation and Inheritance

Answer: (d).Encapsulation and Inheritance

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which feature of OOP is indicated by the following code?

Similar Questions

Discover Related MCQs

Q. Which feature may be violated if we don’t use classes in a program?

Q. How many basic features of OOP are required for a programming language to be purely OOP?

Q. The feature by which one object can interact with another object is:

Q. ___________ underlines the feature of Polymorphism in a class.

Q. Which feature in OOP is used to allocate additional function to a predefined operator in any language?

Q. Which among doesn’t illustrates polymorphism?

Q. Exception handling is feature of OOP. State True or False.

Q. Which among the following, for a pure OOP language, is true?

Q. OOP provides better security than POP:

Q. Which among the following best describes polymorphism?

Q. What do you call the languages that support classes but not polymorphism?

Q. Which among the following is the language which supports classes but not polymorphism?

Q. If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called?

Q. Which type of function among the following shows polymorphism?

Q. In case of using abstract class or function overloading, which function is supposed to be called first?

Q. Which among the following can’t be used for polymorphism?

Q. Which among the following can show polymorphism?

Q. Polymorphism is possible in C language.

Q. Which problem may arise if we use abstract class functions for polymorphism?

Q. Which among the following is not true for polymorphism?