title: Enum static or non-static method
body: <p>Consider the following enum class</p>
  
  <pre><code>public enum ClassA {
      CHECK1("X", 0),
      CHECK2("Y", 2),
      CHECK3("Z", 1);
  
      private final String id;
      private final String cdValue;
  
      private ClsA(String id, String cdValue) {
          this.id = id;
          this.cdValue = cdValue;
      }
  
      private String getId() {
          return id;
      }
  
      private String getCdValue() {
          return cdValue ;
      }
  
      private static final List&lt;String&gt; cdValues = new ArrayList&lt;String&gt;();
  
      static {
          for (ClassA clsA : ClassA.values()) {   
              cdValues.add(clsA.getCdValue());    
          }
      }   
  
      public boolean isCdValue(String cdValue)
      {
          if clsValues.contains(cdValue)
              return true;
          else return false;
      }   
  }
  </code></pre>
  
  <p>The question that I have is does the method <code>isCdValue</code> has to be static. I have to use this method <code>isCdValue</code> for every input given by the client. Therefore the method parameter <code>cdValue</code> changes for every input. </p>
  
  <p>If it cannot be static then I would like to know how I can access this method. Please note I am primarily interested in learning about static of non-static method call. If it is a non-static call in a enum then how can we call this non static method. I am not trying to resolve the issue of how to get about checking the <code>cdValue</code> exists or not. It is just an example.</p>