Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
m Reverted edits by 150.104.250.202 (talk) (HG)
Line 44:
=== Default constructors ===
 
If the programmer does not supply a constructor for an instantiable class, most languages will provide a ''[[default constructor]]''.

The suck mebehavior of the default constructor is language dependent. It may initialize data members to zero or other same values, or it may do nothing at all.
 
Some languages (Java, C#, VB .NET) will default construct arrays of class types to contain null references. Languages without null references may not allow default construction of arrays of non default constructible objects, or require explicit initialization at the time of the creation (C++):