public class EnumFromInt<TEnum extends Enum<TEnum>> {
private static TEnum[] _values;
private static TEnum[] GetValues() {
if (_values != null)
{
return _values;
}
_values = TEnum.values();
return _values;
}
}
Above, there are two instances of "cannot be referenced from a static context". They seem separate, so I'll treat them as different problems. I'd like to understand both.
TEnum[]
- Why? It's an array of whatever type TEnum is. (Well, that's what I'd like it to be)TEnum.values()
- TEnum is declared to be of type Enum, so shouldn't I be able to use the static functions that belong to all enums?