+ 1
Can Anyone tell the exact difference between Data hiding and Encapsulation ? Not links to stackoverflow or quora. thanks in advn
2 Respostas
+ 3
Encapsulation and data hiding can in many definitions be an interchangeable concept, but consider this:
A variable/field/method can be public, default, protected or private thanks to encapsulation, a public method was encapsulated as well as a private one, but data hiding is a "conceptualized technique" used in programming to avoid the modification of a variable/field/method in a direct way. Setters and getters are good examples of encapsulated data hiding. Hope this helps Ansari.
+ 1
much better 😊😊