Encapsulation (computer programming): Difference between revisions

Content deleted Content added
Changed 'orthogonal' link to link to the computer science part of the page
Shnako (talk | contribs)
m Changed protected to restricted, because "protected" is an access modifier and could have caused confusion.
Line 17:
Almost always, there is a way to override such protection &ndash; usually via reflection API (Ruby, Java, C#, etc.), sometimes by mechanism like name mangling ([[Python (programming language)|Python]]), or special keyword usage like <code>friend</code> in C++.
 
Below is an example in [[C Sharp (programming language)|C#]] that shows how access to a data field can be protectedrestricted through the use of a <code>private</code> keyword:
<source lang="csharp">
namespace Encapsulation