+ 6
What is the difference between encapsulation and information hiding in object oriented programming ?????
4 Respuestas
+ 12
I always thought that data hiding was one aspect of encapsulation while the other is keeping fields and functions together.
+ 9
What I can understand is, encapsulation is about keeping related data together or say bundling the data. Like, a class can have methods for particular job.
And data hiding is way to hide data from other parts of the program. Like, by using private keyword in Java, we can hide data from being accessible by other part of the program. Encapsulation is also in a way can be used for data hiding.
0
The main difference between data hiding and encapsulation is that data hiding focus more on data security and encapsulation focuses more on hiding the complexity of the system.
0
I think encapsulation is for multiple use and hiding is to make the usage either private or never open for use at all