After compilation instance init blocks become part of constructors. javac
simply adds the init block to each constructor, that is this:
public class Test1 {
int x;
int y;
{
x = 1;
}
Test1() {
y = 1;
}
}
Is equivalent to this:
public class Test1 {
int x;
int y;
Test1() {
x = 1;
y = 1;
}
}
So the init block runs when constructor runs.