Thursday, September 5, 2013

What is Encapsulation ?

Encapsulation:

- Binding of data and methods as single unit.
e.g: class

Advantage: 
- we can use the same varaible or names in different classes.



If any class contains DataHiding + Abstraction , we call it as Encapsulation.
e.g: javabean  or POJO (plain old java object)

Advantage:  
- It increases security
- Enhancement is easy.
- Improves maintainability.

No comments:

Post a Comment