私はEclipseideで書かれた以下のコードを持っています:
public interface X
{
final public static int SOME_CONST = 0;
}
public class Handle implements X
{
protected void methodHandle () { }
//...
}
public class User implements X
{
Handle handle = new Handle();
private void methodUser ()
{
Y y = new Y() // anonymous inner class
{
public void methodY ()
{
handle.methodHandle (); // <--- why this is NOT giving error ?
}
}
}
}
ですHandle.methodHandle ()
がprotected
、匿名の内部class
メソッドの内部メソッドから呼び出すことができますか?なぜそれが起こっているのですか、私は何かが欠けていますか?Handle
との間の唯一の関係User
は、それらがimplement
同じであるということX
です。