Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Object Oriented Programming/Encapsulation

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Encapsulation In-the oriented approach, classes,and therefore also objects of that class,are similar to black boxes with a clearly defined interface. This interface is the only mechanism that other objects can use to communicate with the object We say that inside a class, behind the interface, the data and implementation of the operations are encapsulated or enclosed in a capsule. This makes the internal workings of a class invisible to all other classes. This is a good technique, since there is no need for other classes to know the internal structure of this class,in other words, how it represents its data and how it performs its operations. We call this encapsulation information hiding. See also Wikipedia:Encapsulation_(computer_programming) Programming Fundamentals/Encapsulation