public enum Parent {
item1(1){
public void testing() {
add();
multiply();
minus(); // error here!!!
}
}, item2(2);
private int i ;
Parent(int i){
this.i = i;
}
public void setI(int i ){
this.i = i;
}
public int getI(){
return i;
}
public void multiply(){
}
protected void add(){
}
private void minus(){
}
}
ご覧のとおり同じクラスなのに、どうしてminus()
内部で使えないのですか?通常、内部クラスprivate method/field
は外部クラスにアクセスできますよね?