title: java enum usage getting and setting
body: <p>I'm here trying to get and set an enum inside a class object, but not sure how to do it. this is what I have so far. I've looked up all I could some examples seem too complex for me to understand. Any help please? </p>
  
  <pre><code>public class EnumExample {
  
  public static class Task {
  
      private String _task;
  
      public enum Priority {
  
          ZERO (0), MAYBE (1), LOW (2), MEDIUM (3), HIGH (4), EXTREME (5);
  
          private int _priority;
  
          Priority() {
              _priority = 0;
              // Does this set set the default priority level to 0??
          }
  
          Priority(int priority) {
              _priority = priority;
              // This is where I can set the priority level of this task??
          }
  
          public int getPriority() {
              return _priority;
          }
  
          public void setPriority(int priority) {
              _priority = priority;
          }
      }
  }
  
  
  
  public static void main(String[] args) {
  
      Task task = new Task();
      task._task = "Study for test";
      System.out.println(task._task);
      System.out.println(task.getPriority());
  
      // How do I set the priority level for task "study for test"??
      // task.Priority = task.Priority.EXTREME;
  
      // How do I retrieve the value of priority??
      // System.out.println(task._task.getPriority());
  
  }
  </code></pre>
  
  <p>}</p>