I have the following class along with a nested enum:
public class MyClass {
private Integer field;
private enum SelectedValue{
ALL {
@Override
public Integer getAmount() {
return field; //Error: field cannot be resolved to a variable
}
};
public abstract Integer getAmount();
}
}
Is it possible to get enclosing instance within the enum body?