title: Java enum placement in Interface or Class
body: <p>I am trying to understand enums in Java, but currently can not find a post that explains the question I am asking.</p>
  
  <p>I have a <code>Person</code> interface and a <code>PersonEO</code> class. Two methods of the Person Interface are setGender and getGender. I would like to hold gender as an enum. </p>
  
  <p>Do I create the enum in the interface and have it get carried over to the class or do I make the enum in the class?</p>
  
  <p>This is currently what I have been trying but can not get the enum to pass over to the class properly and don't really understand how it will flow through the program.</p>
  
  <pre><code>public interface Person{
      public enum gender{
      Female,
      Male,
      Unknown;
  
         private String gender;
  
         public String getGender(){
         }
  
         void setGender(){  
         }
  }
  
  
  ------------------------------------------------------
  
  
  public class PersonEO implements Person {
     //Both override methods are not seen as methods from the interface
  
     @Override
     public String getGender() {
         return gender;
     }
  
     @Override
     public void setGender() {
         //Not sure how to set the gender from the enum
         this.gender = gender;
     }
  }
  </code></pre>
  
  <p>Please show an example.</p>