title: Java: using switch statement with enum under subclass
body: <p>First I'll state that I'm much more familiar with enums in C# and it seems like enums in java is a quite mess.</p>
  
  <p>As you can see, I'm trying to use a switch statement @ enums in my next example but I always get an error no matter what I'm doing.</p>
  
  <p><strong>The error I receive is:</strong></p>
  
  <blockquote>
    <p>The qualified case label <code>SomeClass.AnotherClass.MyEnum.VALUE_A</code> must be replaced with the unqualified enum constant <code>VALUE_A</code></p>
  </blockquote>
  
  <p>The thing is I <em>quite</em> understand the error but I can't just write the VALUE_A since the enum is located in another sub-class. Is there a way to solve this problem? And why is it happening in Java?</p>
  
  <pre><code>//Main Class
  public class SomeClass {
  
      //Sub-Class
      public static class AnotherClass {
          public enum MyEnum {
              VALUE_A, VALUE_B
          }    
          public MyEnum myEnum;
      }
  
      public void someMethod() { 
          MyEnum enumExample //...
  
          switch (enumExample) {
              case AnotherClass.MyEnum.VALUE_A: { &lt;-- error on this line
                  //..
                  break;
              }
          }
      }
  }
  </code></pre>