Encapsulation in Java
Encapsulation in Java
com
http://www.javatpoint.com/encapsulation
Encapsulation in Java
next prev
Encapsulation in java is a process of wrapping code and data together into a single unit , for example capsule
i.e. mixed of several medicines.
We can create a fully encapsulated class in java by making all the data
members of the class private. Now we can use setter and getter methods to
set and get the data in it.
The Java Bean class is the example of fully encapsulated class.
1/2
2/2