I have a class BaseNumber with a protected static enum Base, and another class ArithmeticBaseNumber extends BaseNumber.
I can access the Base enum from BaseNumber, however not from ArithmeticBaseNumber.
Is there a way to access the enum?
Thank you!
Edit - The code:
public class BaseNumber {
protected static enum Base {
X, Y, Z
}
}
public class ArithmeticBaseNumber extends BaseNumber {}
The problem is that BaseNumbe.Base.X works fine, however ArithmeticBaseNumber.Base.X gives "The type ArithmeticBaseNumber.Base is not visible" error.
protectedmembers. But why do you want to access the constant viaArithmeticBaseNumber.Base.X? It’s still the same constant as when being accessed viaBaseNumber.Base.X. There is no advantage in using the other expression.BaseNumberclass at all.ArithmeticBaseNumber.Base.Xstill implies usingBaseNumber, asBaseis a nested type ofBaseNumber.