title: Java enum function return value
body: <p>I'm trying to make a simple script that will return the velue of an enum, let's just give an example:
  //EG.class (should return the Animal ID.</p>
  
  <pre><code>import Object.Animal;
  
  public class EG {
      public void main() {
          Animal AnimalID = Object.Animal.CAT;
  
          System.out.print(AnimalID);
          //Should return value of CAT: 2000 (long)
          //But I can't figure out what's wrong.
      }
  }
  </code></pre>
  
  <p>//Object.class</p>
  
  <pre><code>public class Object {
      public enum Animal {
          CAT(2000L), DOG(2001L), MONKEY(2002L), TIGER(2003L);
  
          private long animal;
  
          private Animal(long a) {
            animal = a;
          }
  
          public long getAnimal() {
            return animal;
          }
      }
  }
  </code></pre>