Question

Which of the following is responsible for hiding of the data?

A Inheritance Correct Answer Incorrect Answer
B Encapsulation Correct Answer Incorrect Answer
C Polymorphism Correct Answer Incorrect Answer
D Abstraction Correct Answer Incorrect Answer
E Generalization Correct Answer Incorrect Answer

Solution

Polymorphism : It is a OOPs concept that is refers the ability of an object/variable/method to take multiple forms. Example: "Animal" class has different sub-classes like horse, fish, tiger etc. "Animal" class has one method called "Move" which will be defined in different ways in subclasses. Like when for "horse" class it will be as "trotting" while for "Fish" class it will be "Swimming". Inheritance : It refers to the ability of subclass to inherit features of the parent class. It leads to helps re-usability of code. Encapsulation : It refers to binding of methods/variables/objects of one class together. Abstraction : It refers to the hiding of the data. Generalization : It refers to grouping of subclasses into one class. Like Permanent faculty and Guest

Practice Next

Relevant for Exams:

×
×