What is encapsulation technique

Q

What is encapsulation technique?

✍: Guest

A
Hiding data within the class and making it available only through the methods. This technique is used to protect your class against accidental changes to fields, which might leave the class in an inconsistent state.

2007-11-16, 6014👍, 0💬