OOPs Concept: Encapsulation

 Encapsulation

  • It is process of wrapping up data member & methods together into a single unit.
  • Every Java Class is an example of encapsulation.
  • Two ways of achieving Encapsulation: 
               a) Declaring the instance variable : as private
               b) Provide public setter & getter method








Comments

Popular posts from this blog

Asynchronous Communication

Types of NoSQL Database

Difference between HLD(High Level Design) and LLD(Low Level Design)?