filmov
tv
What is encapsulation in Java? What is encapsulation with an example?

Показать описание
Encapsulation in Java refers to integrating data (variables) and code (methods) into a single unit. In encapsulation, a class's variables are hidden from other classes and can only be accessed by the methods of the class in which they are found.