title: Why are there compile errors when accessing an Enum from the main method?
body: <p>So i'm a little bit confused as i've never used an enum before. I want to use this enum in my main method. For some reason, i can't (i keep getting errors anytime i even try to do <code>Status s;</code> in main). I can however call my <code>TestingEnum</code> method from main and of course this works... but i am 100% sure that using the enum this way is just plain wrong. Could someone tell me how i'd go about using this in main properly?</p>
  
  <p>If i try to do: Status s; in my main method, i get this error - "connot find symbol Status s;"</p>
  
  <p>BACKGROUND: new to java and enums...</p>
  
  <pre><code>class MyClass {
      public Status s;
  
      public enum Status {
          STATUS_OPEN(1), 
          STATUS_STARTED(2), 
          STATUS_INPROGRESS(3), 
          STATUS_ONHOLD(4), 
          STATUS_COMPLETED(5), 
          STATUS_CLOSED(6);
  
          private final int status;
  
          Status(int stat) {
              this.status = stat;
          }
  
          public int getStatus() {
              return this.status;
          }
  
      }
  
      private void setStatus(Status stat) {
          s = stat;
      }
  
      public void TestingEnum() {
          Status myStat = Status.STATUS_ONHOLD;
          setStatus(myStat);
      }
  
      @Override
      public String toString() {
          StringBuilder result = new StringBuilder();
          String NEW_LINE = System.getProperty("line.separator");
  
          result.append(NEW_LINE + " Status: " + s + NEW_LINE);
  
          return result.toString();
      }
  }  
  
  public class Main {
      public static void main(String[] args) {
          MyClass obj = new MyClass();
  
          // PROBLEM SETTING STATUS HERE
          // I can't do this:
          Status s;
  
      }
  }
  </code></pre>