Interviews2 answers
Explain the difference between encapsulation and datahiding ?
2 Answers
data hiding is a technique of hide data from external world and encapsulation provide a way for implementation of desired level of data hiding using access specifiers
like private ,public,protected,internal,protected internal
Pankaj Kumar ChoudharyPosted Mar 31, 2015, 6:17 AM EDT
In encapsulation you encapsulate function and data together in one unit (class).
In data hiding you simply hide the data from external world. Only the member function can access the data.
Ranjit PowarPosted Apr 24, 2014, 1:47 AM EDT

