OOPS Concepts
OOPS Concepts
information. It solves the problem in desing level itself. Encapsulation: Encapsulation is used for hide the code and data in a single unit to protect the data from the outside the world. It solves the problem in implementation level. Ex:Class Difference between Encapsulation and Abstraction 1. Abstraction solves the problem in the design level 1. Encapsulation solves the problem in the implementation level 2. Abstraction is used for hiding the unwanted data 2. Encapsulation means hiding the code and data in and giving relevant data to a single unit to protect the data from outside world 3. Abstraction is a technique that helps to identify 3. Encapsulation is the technique for packaging the which specific information should be visible and information in such a way as to hide what should be which information should be hidden. hidden, and make visible what is intended to be visible.