Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Encapsulation

Encapsulation is the practice of bundling data, in properties, and methods that operate on that data into a single unit, a class, while restricting direct access to some of the object’s components.

Encapsulation relies mostly on classes and visibility, to control access to data.

This is a fundamental principle of OOP, promoting security, modularity, and maintainability.

Documentation

See Also