title: enum implementation inside interface - Java
body: <p>I have a question about putting a Java enum in the interface.
  To make it clearer, please see the following code:</p>
  
  <pre><code>public interface Thing{
     public enum Number{
         one(1), two(2), three(3);
         private int value;
         private Number(int value) {
              this.value = value;
         }
         public int getValue(){
          return value;
         }
     }
  
     public Number getNumber();
     public void method2();
     ...
  }
  </code></pre>
  
  <p>I know that an interface consists of methods with <strong>empty bodies</strong>. However, the enum I used here needs a constructor and a method to get an associated value. In this example, the proposed interface will not just consist of methods with empty bodies. Is this implementation allowed? </p>
  
  <p>I am not sure if I should put the enum class inside the interface or the class that implements this interface. </p>
  
  <p>If I put the enum in the class that implements this interface, then the method public Number getNumber() needs to return the type of enum, which would force me to import the enum in the interface.</p>