Search This Blog

Tuesday, December 30, 2008

What is Encapsulation and Abstraction

Encapsulation:
Encapsulation is nothing but grouping related data .exaple in Patient Class we will write all the functionality related to Patient.i.e all patient related data i am putting in one place called Patient Class This is called Encapsulatin.
Abstraction:
in Patient class i might be having public,private,internal methods,properties etc..
if anybody creates object to Patient class they only get either Public and or internal methods or prperties not private methods,properties or fields.so patient class is expsing only few methods or properties as public or internal methds or properties while not showing private things this is called abstraction.

No comments: