posted 22 years ago
Howdy!
An instance initializer is processed JUST BEFORE the constructor, as you create an instance of a class.
So doing
is roughly equivalent with
The instance initializer is mostly used in anonymous classes, where you can't have constructors (since the anonymous class does not have a name). There the instance initializer is the only way to pre-initialize instance members.
Hope this helps!
/Kaspar