Page 18 - CA_Blue( J )_Class10
P. 18
1.4.3 Difference between Abstraction and Encapsulation
Abstraction Encapsulation
Issues at the design level can be solved. Issues at the implementation level can be solved.
Abstraction is about hiding unwanted details and showing In encapsulation, the methods and data are kept in a
only the essential information. single unit.
Abstraction focuses on what the information object must It hides the internal details of how an object does
contain. something for security reasons.
1.4.4 Inheritance
Inheritance is the method that allows one class to inherit the properties (data members and member methods) of
another class. The class from which features are inherited to another class is known as superclass. It is also known as
base class or parent class. In the real world, a child inherits the properties (both materialistic and non-materialistic) of
its parents who in turn have inherited from their parents.
The class which inherits the features of another class is known as a subclass. It is also called a derived class, an extended
class, or a child class. Apart from features of the base class, it may have its own the features (data members and
methods). Let us take an example,
In the above example, Vertebrate is superclass and Fish and Mammal are subclass as both fishes and mammals have
backbones which are the properties of the superclass Vertebrate.
Concept of Reusability
While developing a code, there may be a requirement to create more than one class. In such a situation, we may share
the data members and methods of one class with another class. It is known as the concept of Reusability. This helps to
reduce the coding time as well as the complexity of the codes.
1.4.5 Polymorphism
The word polymorphism comes from the Greek words "poly", which means "many", and "morphe", which means
"change of forms". It is the ability of an object to take on many forms.
Let’s take an example of polymorphism. A man sometimes is an employee in an office, is a father of a child, is a
customer in a shop and also a tourist when visiting a place.
1616 Touchpad Computer Applications-X

