Encapsulation
- Encapsulation is a process of wrapping code and data together into a single unit
- We can create a fully encapsulated class by making all the data members of the class private
- Java Bean class is the example of fully encapsulated class
1. Advantage
- You can make the class read-only or write-only
- It provides you the control over the data
2. Example
'Back-End > Java_1' 카테고리의 다른 글
[Java] Multithreading in java (0) | 2016.10.05 |
---|---|
[Java] Call by value (0) | 2016.09.13 |
[Java] Package (0) | 2016.09.12 |
[Java] Interface (0) | 2016.09.12 |
[Java] Abstract class (0) | 2016.09.12 |