Encapsulation (computer programming): Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Citation needed}}
Line 44:
==== Restricting data fields ====
Languages like [[C++]], [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]], [[PHP]], [[Swift (programming language)|Swift]], and [[Delphi (programming language)|Delphi]] offer ways to restrict access to data fields.
 
[[File:UML encapsulation.svg]]
 
Below is an example in [[C Sharp (programming language)|C#]] that shows how access to a data field can be restricted through the use of a <code>private</code> keyword: