What is encapsulation in object oriented programming ?

Описание к видео What is encapsulation in object oriented programming ?

Encapsulation bundles data (attributes) and methods together inside the wrapper called class.
Similar to capsules where different kind of medicines are are kept together inside the top cover, here data and methods are kept inside top cover called called "class".
To consume medicines inside capsule, first we need to uncover top layer. Similarly here, to access data and methods of class we need to uncover class by creating object for this.

Комментарии

Информация по комментариям в разработке