General Definition
In general, encapsulation is one of the 4 fundamentals of OOP (object-oriented programming). Encapsulation is to hide the variables or something inside a class, preventing unauthorized parties to use. 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. 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.
Read more about this topic: Encapsulation (object-oriented Programming)
Famous quotes containing the words general and/or definition:
“[The Republican Party] consists of those who, believing in the doctrine that mankind are capable of governing themselves and hating hereditary power as an insult to the reason and an outrage to the rights of men, are naturally offended at every public measure that does not appeal to the understanding and to the general interest of the community.”
—James Madison (17511836)
“The definition of good prose is proper words in their proper places; of good verse, the most proper words in their proper places. The propriety is in either case relative. The words in prose ought to express the intended meaning, and no more; if they attract attention to themselves, it is, in general, a fault.”
—Samuel Taylor Coleridge (17721834)