title: Can you make Java enums over Classes?
body: <p>I am not a Java programmer, but I need to write some Java code, and I have been reading about Java enums, that Java enum class is a special type of class which were introduced in Java 5 to replace int constants. My question is, since there are two types one primitive, <code>int</code> and the other <code>Integer</code> which is a class, is it possible to create enums out of classes?
  Can I have the following for instance?</p>
  <pre class="lang-java prettyprint-override"><code>enum ClassEnum {
   Integer,
   Double,
   MyClass
  }
  </code></pre>
  <p>The reason I want to do it is because I have 3-4 classes that I need to <code>switch</code> on, a dispatch certain methods based on what class I get in my <code>switch</code>. All <code>N</code> classes that I will be switching over have their own structure, and as a result needs to be handled differently based on what type they are. They are all part of one common abstract class though.</p>