WELCOME TO MY
PRESENTATION
ENCAPSULATION
Encapsulation in Java is a process of wrapping
code and data together into a single unit.
Encapsulation is one of the four fundamental OOP
concepts. The other three are inheritance,
polymorphism, and abstraction.
2
 To hide internal implementation details of the class.
 Can safely modified the implementation without worrying breaking the existing
code that uses the class.
 Protect class against accidental/willful stupidity Protect class against
accidental/willful stupidity.
 Keep class tidy by keeping the visible fields to a minimum.
3
The fields of a class can be made read-only of
write-only.
A class can have total control over what is
stored in its fields.
The users of a class do not know how the class
stores its data.
A class can change the data type of a field and a
users of the class do not need to change any of
their code.
 Encapsulation makes the code easier to visualize.
 This means codes can be arranged "visually" before
implementation.
5
6
7
 Encapsulation is the technique of making the fields in a class
private and providing access to the fields via public methods.
 The main benefit of encapsulation is the ability to modify the
implemented code without breaking the code of others who
use the implemented code.
THANK YOU

Encapsulation

  • 1.
  • 2.
    ENCAPSULATION Encapsulation in Javais a process of wrapping code and data together into a single unit. Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. 2
  • 3.
     To hideinternal implementation details of the class.  Can safely modified the implementation without worrying breaking the existing code that uses the class.  Protect class against accidental/willful stupidity Protect class against accidental/willful stupidity.  Keep class tidy by keeping the visible fields to a minimum. 3
  • 4.
    The fields ofa class can be made read-only of write-only. A class can have total control over what is stored in its fields. The users of a class do not know how the class stores its data. A class can change the data type of a field and a users of the class do not need to change any of their code.
  • 5.
     Encapsulation makesthe code easier to visualize.  This means codes can be arranged "visually" before implementation. 5
  • 6.
  • 7.
    7  Encapsulation isthe technique of making the fields in a class private and providing access to the fields via public methods.  The main benefit of encapsulation is the ability to modify the implemented code without breaking the code of others who use the implemented code.
  • 8.