Difference between revisions of "Constructors - 2017"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "A constructor method has the same name as the class. It is used when an instance of the class is created, the constructor method will always be run. A class can have many cons...")
 
Line 1: Line 1:
A constructor method has the same name as the class.
+
*A constructor method has the same name as the class.
It is used when an instance of the class is created, the constructor method will always be run.
+
*It is used when an instance of the class is created, the constructor method will always be run.
A class can have many constructor methods.
+
*A class can have many constructor methods.

Revision as of 06:18, 26 May 2017

  • A constructor method has the same name as the class.
  • It is used when an instance of the class is created, the constructor method will always be run.
  • A class can have many constructor methods.