Professional Documents
Culture Documents
Data Encapsulation
Data Encapsulation
1
What are we doing today?
Introduction of:
OOPS
3 IMPORTANT THINGS
ENCAPSULATION
ACCESS METHODS
EXAMPLES
2
OBJECT ORIENTED PROGRAMMING
4
THREE IMPORTANT THINGS
• Encapsulation:
Sometimes referred to as data hiding, is the
mechanism whereby the implementation details of a class
are kept hidden from the user.
• Inheritance :
One object acquired the properties of other object.
• Polymorphism:
One interface multiple methods.
5
ENCAPSULATION
6
ACCESS METHODS
• Private:
Objects accessed only inside the class.
• Public:
Objects accessed anywhere in the program.
• Protected:
Methods of the class only can access.
7
Encapsulation into the Protocol Layer
8
ADVANTAGES
• Reuse of objects.
9
Example
Student marks
Social Network Account
THANK YOU
11