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 — Java
All classes automatically get a no-argument constructor
CannotChainMemberToConstructor — Java
Method calls or field accesses cannot be chained to a constructor invocation
ConstructorAllocates — Java
The constructor allocates the object
ConstructorParameterIsField — Java
Formal constructor parameters are equivalent to instance variables
ConstructorReturnsObject — Java
Constructors need to return objects
ConstructorWithoutNew — Java
One can write the constructor name, without new, to instantiate a class
ImmutableRequiresFinalParameters — Java
Immutable classes need final constructor/method parameters
MustInitializeFieldInConstructor — Java
Constructors must assign values to all fields
NoEmptyConstructor — Java
A constructor must do something
NoInsideMethodCallInConstructor — Java
It is foirbidden to call other methods on the same object while inside its constructor
ObjectsMustBeNamed — Java
A variable is needed to instantiate an object
ThisInConstructorIsNull — Java
In a constructor, this is null
CannotChainAttributeToObjectInstantiation — Python
Method calls, and attribute accesses in general, cannot be chained to a constructor invocation.
InitCreates — Python
__init__ must create a new object
InitReturnsObject — Python
__init__ needs to return an object
NoEmptyInit — Python
__init__ must do something
ObjectsMustBeNamed — Python
A variable is needed to instantiate an object