What does encapsulation mean? Please describe the advantages and disadvantages of Encapsulation.
Singasani Akshay
Asked: January 9, 20222022-01-09T14:12:07+00:00
2022-01-09T14:12:07+00:00In: Technology, Website Development
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Encapsulation Definition:
Encapsulation, also known as OOP (Object-Oriented Computer Programming), is an assortment of data which has been put together or bundled. It operates in a single composite unit and can be classified also.
To simplify the meaning, we can say it is a mechanism under which the direct access to some parts of an object is restricted. Thus, a programme can be hidden for restricted use. It is basically a privacy safety mechanism.
Privacy is protected: Restricted information or data can be accessed only with the use of the code within the same class.
Merits or Benefits of Encapsulation:
Demerits or Disadvantages of Encapsulation
The Conclusion:
The OOP has four fundamental concepts with encapsulation being one. The others are inheritance, polymorphism, and abstraction. The data (variables) and code acting on the data (methods) are wrapped together as a single composite unit. This is also known as a data-hiding process or method.
The variables of a class remain hidden from other classes. Subsequently, they can be accessed only through the methods of their current class.