What is encapsulation in OOP with example?

A class is a program-code-template that allows developers to create an object that has both variables (data) and behaviors (functions or methods). A class is an example of encapsulation in computer science in that it consists of data and methods that have been bundled into a single unit .

Sizin İçin Seçtik  What is base class and derived class with example?

Leave a Reply

Your email address will not be published. Required fields are marked *