Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
No edit summary
Line 48:
If the programmer does not supply a constructor for an instantiable class, most languages will provide a ''[[default constructor]]''.
 
The behavior 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.
In C++ a default constructor is required if an array of class objects is to be created.
Other languages (Java, C#, VB .NET) have no such restriction.
 
=== Copy constructors ===