Encapsulation explained with real world example in Java

preview_player
Показать описание
Encapsulation is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes and can be accessed only through the methods of their current class.
In the television example, we are hiding inner core data, that is, circuits from the external world by the cover.

Links
----------

Рекомендации по теме
Комментарии
Автор

Show some problems related to encapsulation in java

akhilsat