Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
Notes are now separated from the references
Formatting cleanups, per MOS:BOLD
Line 183:
==== C# static constructor ====
 
In [[C Sharp (programming language)|C#]], a '''static constructor''' is a static data initializer. Static constructors are also called '''class constructors'''. Since the actual method generated has the name '''.cctor''' they are often also called "cctors".<ref>{{cite web|url=http://ericlippert.com/2013/02/06/static-constructors-part-one/ |title=Fabulous Adventures in Coding |publisher=Eric Lippert |date=2013-02-06|accessdate=2014-04-05}}</ref>
 
Static constructors allow complex static variable initialization.<ref>[http://msdn.microsoft.com/en-us/library/k9x6w0hc%28VS.80%29.aspx Static Constructor in C# on MSDN]</ref>
Line 293:
=== Eiffel ===
 
In [[Eiffel (programming language)|Eiffel]], the routines which initialize new objects are called '''creation procedures'''. Creation procedures have the following traits:
 
* Creation procedures have no explicit return type (by definition of '''procedure''').{{Efn|Eiffel '''routines''' are either '''procedures''' or '''functions'''. Procedures never have a return type. Functions always have a return type.}}
* Creation procedures are named.
* Creation procedures are designated by name as creation procedures in the text of the class.