InterviewSolution
Saved Bookmarks
| 1. |
What is Encapsulation in oops with an example? |
|
Answer» The process of binding up data and FUNCTIONS together that manipulates them is known as encapsulation in OOPS. It PROTECTS the data from outside interference and misuse. Let’s understand the concept of encapsulation with both real-world examples and with the help of a program. It is an attribute of an object, and it contains all data which is hidden. That hidden data is restricted to the members of that class.Exampleclass Account { PUBLIC void show Data() { public void deposit(int a) { |
|