Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

According to The Java Language Specification, §12.5, "Creation of New Class Instances" [JLS 20052015]:

Unlike C++, the Java programming language does not specify altered rules for method dispatch during the creation of a new class instance. If methods are invoked that are overridden in subclasses in the object being initialized, then these overriding methods are used, even before the new object is completely initialized.

...

ISO/IEC TR 24772:2010

Inheritance [RIP]

Secure Coding Guidelines for Java SE, Version 5.0

Guideline 7-4 / OBJECT-4: Prevent constructors from calling methods that can be overridden

Bibliography

[ESA 2005]

Rule 62, Do not call nonfinal methods from within a constructor

[JLS 20052015]

Chapter 8, "Classes"
§12.5, "Creation of New Class Instances"

[Rogue 2000]

Rule 81, Do not call non-final methods from within a constructor

Secure Coding Guidelines for the Java Programming Language, Version 3.0

Guideline 4-4, Prevent constructors from calling methods that can be overridden

 

...