title: defining constants like #define that can be used in switch statements in java
body: <p>I would like to define some constants like <code>#define myXYZ 1</code> so I can also use them in <code>switch</code> statements. </p>
  
  <p>When I do the often suggested   </p>
  
  <pre><code>public static final Integer myXYZ = 1;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>case Constants.myXYZ:
  </code></pre>
  
  <p>I get the compiler message that <code>case expression must be constant</code></p>
  
  <p>What would be the best way of resolving this?</p>
  
  <p>Thanks!</p>