Encapsulation in Object Oriented Programming is about keeping data in classes private. The object or data are figuratively placed in a capsule where what is observed by other objects is the capsule not the object or data. inside. This also means that the characteristics of the objects are hidden from direct access. This can mean that the code in the class wont be that affected much with changes in the code made by other people
Purpose:
Protect Object Characteristics from unwanted changes.
Reference:
Head First C#
No comments:
Post a Comment