in eineIn [[programming languages]], <!-- [[object-oriented programming language]]--> <!-- and related fields, like [[OODMBS]],--> '''encapsulation''' is used to refer to one of two related but distinct notions, and sometimes to the combination<ref>{{cite book |first=Michael Lee |last=Scott |title=Programming language pragmatics |edition=2 |publisher=Morgan Kaufmann |year=2006 |isbn=0-12-633951-1 |page=481 |quote=Encapsulation mechanisms enable the programme<sup></sup>r to group data and the subroutines that operate on them together in one place, and to hide irrelevant details from the users of an abstraction.}}</ref><ref name=Dale>{{cite book |first=Nell B. |last=Dale |first2=Chip |last2=Weems |title=Programming and problem solving with Java |edition=2nd |publisher=Jones & Bartlett |year=2007 |isbn=0-7637-3402-0 |page=396}}</ref> thereof:
* A language mechanism for restricting direct access to some of the [[object (computer science)|object]]'s components.<ref>{{cite book |authorlink=John C. Mitchell |first=John C. |last=Mitchell |title=Concepts in programming languages |publisher=Cambridge University Press |year=2003 |isbn=0-521-78098-5 |page=522}}</ref><ref name=Pierce>{{cite book |last=Pierce |first=Benjamin |authorlink=Benjamin C. Pierce |title=[[Types and Programming Languages]] |publisher=MIT Press |year=2002 |isbn=0-262-16209-1 |page=266 |ref=harv}}</ref>