Escolar Documentos
Profissional Documentos
Cultura Documentos
Presented by
Anip Shah
Inheritance
Code
Object
Oriented
Design
Encapsulat
ion
Polymorphis
m
Abstraction
Abstraction is a mechanism to manage complexity
It is a method of generalizing so that underneath complex logic is
not exposed to the user
An abstraction includes the essential details relative to the
perspective of the viewer
Encapsulation
Encapsulation is the mechanism that binds together code and the
data it manipulates, and keeps both safe from outside interference
and misuse
One way to think about encapsulation is as a protective wrapper
that prevents the code and data from being arbitrarily accessed by
other code defined outside the wrapper
Access to the code and data inside the wrapper is tightly controlled
through a well-defined interface
For example, we do not need to know the internal working of the
mobile phone in order to use it. There is an interface to use it
without knowing implementation details
Encapsulation is achieved in programming using access modifiers
Inheritance
Inheritance is the process by which one object acquires the
properties of another
Without the use of hierarchies, each object would need to define all
of its characteristics explicitly
However, by use of inheritance, an object need only define those
qualities that make it unique within its class. It can inherit its
general attributes from its parent
It can be achieved in programming by extending the superclass to
form subclasses
Code
Polymorphism
Polymorphism is the characteristic of being able to assign a
different meaning or usage to something in different contexts
It allows one interface to be used for a general class of actions. The
specific action is determined by the exact nature of the situation
You use a button by applying pressure to it. What a button does,
however, depends on what it is connected to and the context in
which it is used
Polymorphism can be achieved in programming using method
overloading and method overriding
Code
Thank You