Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
m Cut needless carriage return whitespace characters in sections: to standardize, aid work via small screens. WP:LINKs: add, update-standardize, underscores > spaces, needless WP:PIPEs > WP:NOPIPEs. MOS:FIRSTABBReviation clarify, define before WP:ABBR in parentheses.
Line 428:
 
=== OCaml ===
In [[OCaml]], there is one constructor. Parameters are defined right after the class name. They can be used to initialize instance variables and are accessible throughout the class. An anonymous hidden method called <code>initializer</code> allows to evaluate an expression immediately after the object has been built.<ref>[http://caml.inria.fr/pub/docs/manual-ocaml/ OCaml manual]</ref>
<ref>[http://caml.inria.fr/pub/docs/manual-ocaml/index.html OCaml manual]</ref>
 
<syntaxhighlight lang="ocaml">