This is valid code (compilation):
class Person { Person() { init(); } void init() { // do stuff } } class Employee extends Person { Employee() { super(); } void init() { // do something else } }
And this is very suspicious. Since Person.init can do something critical to the integrity of the class, there is no guarantee that Employee.init will do it either.
Limiting Person.init to private not enough. Employee.init remains valid, but will be Person.init , which will just be very misleading. It is best to make Person.init final , which prohibit the creation of Employee.init .
janos source share