What is encapsulation?

Technology: java OOPs
AskedIn:
Topics:
Type:
  • 1. mechanism to bind properties(variables) and their behaviours (methods) together in a single unit is called data encapsulation
  • 2. the reason why we do encapsulation is to protect data/code of class from any other/outside class and can only be accessed through its own member functions in which it is declared