たとえば、以下のコード スナップを検討してください。
public static final int a;
public static final int b;
static {
a = 8; // it's working
Test.b = 10; // compilation error Test.b cannot be assigned.
}
クラス自体Test.b = 10;
の静的ブロック内で使用できないのはなぜですか? Test
クラス名がなくても問題なく動作します。
これには何か理由がありますか?