Encapsulation (computer programming): Difference between revisions

Content deleted Content added
This whole section was stolen from JavaWorld. Removing.
Line 17:
== General Definition ==
 
In General Encapsulation is one of the 4 fundamentals of OOP(Object Oriented Programming). Encapsulation is to hide the variables or something ininside javaa asclass, nopreventing oneunauthorized outsideparties the class canto use it. So the public methods like getter and setter access it and the other classes call these methods for accessing.
 
This mechanism is not unique to object-oriented programming. Implementations of [[abstract data types]], e.g. [[module (programming)|modules]], offer a similar form of encapsulation. This similarity stems from the fact that both notions rely on the same mathematical fundament of an [[existential type]].<ref>Pierce (2002), Section 24.2 "Data Abstraction with Existentials"</ref>