title: How to return enum value in java
body: <p>How can I return enums like this? </p>
  
  <p>Before I was returing an int with 0 if no, 1 if yes and 2 if other. But this wasn't good way to do. So how should it be done. My code:</p>
  
  <pre><code>class SomeClass{
     public enum decizion{
        YES, NO, OTHER
     }
  
     public static enum yourDecizion(){
        //scanner etc
        if(x.equals('Y')){
           return YES;
        }
        else if (x.equals('N')){
           return NO;
        }
        else{
           return OTHER;
        }
     }
  }
  </code></pre>