Recently MeroSpark is lunched with more features and services, now you can ask your question, sell your books, share your notes and many more. Visit now and create your account to take full advantage of MeroSpark.

Encapsulation – Feature of Object Oriented Programming (OOP)

Download our Android App from Google Play Store and start reading Reference Notes Offline.

encapsulationEncapsulation – Feature/Characteristics of Object Oriented Programming (OOP)
Object Oriented Programming (OOP)
Third Semester | Second year
BSc.CSIT | Tribhuvan University (TU)

In 1991, Rumbaugh and others defined encapsulation as consisting of separating the external aspects of an object which are accessible to other objects, from the internal implementation details of the object, which are hidden from other objects. According to Booch, it is also known as information hiding and it prevent clients from seeing the objects’s inside view, where the behavior of the abstraction is implemented. In reference to classes and object in OOP, encapsulation is the process of enclosing within these classes and objects the attributes and the methods. It is the programmers who specify what information in an object can be shared with other objects.

encapsulation and data hiding concept

Fig: Encapsulation and data hiding concept

Do you think information hiding and encapsulation mean the same thing? No, information hiding cannot be treated as encapsulation, both are related but altogether different aspects. For example; An array or a record structure also encloses the information but this information cannot be said to be hidden. It is true that the encapsulation mechanism like classes and objects hide information but these also provide visibility of some their information through well defined interfaces.

(Visited 659 times, 1 visits today)

Posted By : Digvijay | Comment RSS | Category : Third Semester
Tag :

Post a Comment

Your email is never published nor shared. Required fields are marked *


Wordpress DMCA
Community | Toolbar | Android App | Founder/Developer : Hari Prasad Chaudhary | CSIT Portal Manager : Digvijay Chaudhary