20.1 Encapsulation (cont.)
- Encapsulation restricts access to names
- Same as restricting access to values
- E.g., P1 creates a stack class that P2 will use (prev. chapter):
- Encapsulation limits the information P2 must know
- Data fields are inaccessible to P2
prev
|top
|next