java - Can I do a static import of a private subclass? -


i have enum private, not exposed outside of class. there anyway can static import of type, don't have type enum type each time? or there better way 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 don't want type "myenum"     myenum cat = cat; //compile error, want   } } 

or there better way write this?

if main goals reference items without qualifying enum identifier, , maintain list privately, scrap enum type altogether , use ordinary private static constants.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -