Changes

Jump to navigation Jump to search
m
Correction
Line 17: Line 17:     
==Constructors and Destructors==
 
==Constructors and Destructors==
−
A constructor is a class method that is automatically called when an instance of the class is instantiated.  The purpose of the constructor is to set up the new instance.  A destructor is a method that is called when an instance of the class is destroyed.  The purpose of the destructor is to clean up just prior to the class being deleted.  Typically this includes freeing memory pointed to by instance data.  Some programming languages support special constructors called "copy constructors" which are called when an instance is created as a copy of another instance.
+
A constructor is a class method that is automatically called when an instance of the class is instantiated.  The purpose of the constructor is to set up the new instance.  A destructor is a method that is called when an instance of the class is destroyed.  The purpose of the destructor is to clean up just prior to the instance being deleted.  Typically this includes freeing memory pointed to by instance data.  Some programming languages support special constructors called "copy constructors" which are called when an instance is created as a copy of another instance.
    
== Example (Java)==
 
== Example (Java)==
SkipCaptcha
292

edits

Navigation menu