Let\'s say I have a Java class
abstract class Base {
abstract void init();
...
}
and I know every derived class will have to call <
if Java had it, we wouldn't see all these init() method calls in the wild.
"surround child constructor with something" - that cannot be done in pure java. Too bad, because there can be very interesting applications, especially with anonymous class + instance initialization block.
factory and container - they can be helpful when native new doesn't do the job; but that's trivial and boring, and won't work with anonymous classes.