Break OO privacy: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
(Omit Insitux)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 1,457:
 
However, there is no such thing as a private method. Although conventionally methods which are not intended to be called from outside the class are suffixed with an underscore, this doesn't prevent anyone from accessing them as the following example shows.
<syntaxhighlight lang="ecmascriptwren">class Safe {
construct new() { _safe = 42 } // the field _safe is private
safe { _safe } // provides public access to field
Line 1,474:
84
</pre>
 
=={{header|zkl}}==
In zkl, privacy is more convention than enforced (unlike const or protected).
9,482

edits