Constructor
A constructor is a function that initializes a newly allocated object.
Related concepts: ClassObjectMethod
Closest Wikipedia entry: Constructor (object-oriented programming)
Misconceptions about Constructor17 documented Misconceptions
Check YourselfAllClassesHaveDefaultConstructor
All classes automatically get a no-argument constructor
CannotChainMemberToConstructor
Method calls or field accesses cannot be chained to a constructor invocation
ConstructorAllocates
The constructor allocates the object
ConstructorParameterIsField
Formal constructor parameters are equivalent to instance variables
ConstructorReturnsObject
Constructors need to return objects
ConstructorWithoutNew
One can write the constructor name, without new, to instantiate a class
ImmutableRequiresFinalParameters
Immutable classes need final constructor/method parameters
MustInitializeFieldInConstructor
Constructors must assign values to all fields
NoEmptyConstructor
A constructor must do something
NoInsideMethodCallInConstructor
It is foirbidden to call other methods on the same object while inside its constructor
ObjectsMustBeNamed
A variable is needed to instantiate an object
ThisInConstructorIsNull
In a constructor, this is null