encapsulation
Keeping a class's fields private so other code can change them only through the class's own methods.
Encapsulation hides an object's representation behind a public interface of constructors and methods, so the class can enforce its invariants and change its implementation without breaking callers.
Examples
private int balance;withdepositandwithdrawmethods that check the amount.