Break OO privacy: Difference between revisions

Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag
(Add Ecstasy example)
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag)
Line 459:
 
Exposed expo = new Exposed();
console.printlnprint($"before: {expo}");
 
// you can only access public members from the default reference
Line 482:
expoStr.pri = $"{expoStr.pri}!!!";
 
console.printlnprint($"after: {expo}");
}
}
</syntaxhighlight>
 
{{out}}
Output:
<pre>
<syntaxhighlight>
before: pub="public", pro="protected", pri="private"
after: pub="this was public!!!", pro="this was protected!!!", pri="this was private!!!"
</pre>
</syntaxhighlight>
 
=={{header|F_Sharp|F#}}==
162

edits