I have an enum which is private, not to be exposed outside of the class. Is there anyway I can do a static import of that type, so that I don't have to type the enum type each time? Or is there a better way to write this? Example:
package kip.test;
import static kip.test.Test.MyEnum.*; //compile error
public class Test
{
private static enum MyEnum { DOG, CAT }
public static void main (String [] args)
{
MyEnum dog = MyEnum.DOG; //this works but I don't want to type "MyEnum"
MyEnum cat = CAT; //compile error, but this is what I want to do
}
}