3 ms·
it's simpler for the subclass. the parent class however now has to deal with an arbitrary set of operation that the sub class can perform between the initializ
by avereveard 4y ago
it's simpler for the subclass.
the parent class however now has to deal with an arbitrary set of operation that the sub class can perform between the initializer block and the constructor method, so it's contract is overall much harder to define, because you can no longer be sure of your internal state in the constructor.
- rcme 4y agoThis seems like a solvable problem with static analysis: don’t allow reads from instance variables / methods of the parent class until super is called.