What is Encapsulation? Explain and give an example.
Utilisateur anonyme
Encapsulation is bundling of data with the methods that operate on that data. It is used to hide the values of data objects inside a class, preventing from direct access to them. For example if you make an obj with private acess specifier and want to acces it you cannot access ot directly for this you have to make a public funtion and define it there and then you can use it otherwise you cannot access it