私は外部クラス A を持っていて、それには public 内部クラスがあります。構造は次のとおりです -:
public class A{
public int x;
public class B{
private static final int y;
}
public synchronized int method1(){
return x+ B.y;
}
}
問題は、クラス A のすべてのメソッドで synchronized キーワードを使用した場合、内部クラスのメンバーもロックされるかどうかです。