+ 5
Did not understand the encapsulation? Any one tell me in detail.
C++
2 Respuestas
+ 7
It is basically hiding of data
+ 3
Let's use an example. You start out storing addresses as part of your class. You hide the data by making it private and provide a method to return it. Later, you decide you want to interface with Google Maps. With encapsulation, you can change the data to whatever is needed to implement the Google Maps implementation and only the class needs updating. The rest of the program is unaffected.