title: Initialize a new object from class in Enum
body: <p>I have an Enum called Plugins:</p>
  
  <pre><code>public enum Plugins {
  
      ROTATING_LINE (plugin.rotatingline.RotatingLine.class),
      SNOW_SYSTEM (plugin.snow.SnowSystem.class);
  
      private Class&lt;?&gt; c;
  
      private Plugins (Class&lt;?&gt; c) {
          this.c = c;
      }
  
      public Class&lt;?&gt; getClassObject() {
          return c;
      }
  
  }
  </code></pre>
  
  <p>What I would like to do is to loop through all the enums in <code>Plugins</code> and create new objects from those using the variable <code>c</code> like this:</p>
  
  <pre><code>for (Plugins plugins : Plugins.values()) {
      Class&lt;?&gt; c = plugins.getClassObject();
      pluginList.add(new c(400, 400));
  }
  </code></pre>
  
  <p>Is there a way of accomplishing this with a similar method? The reason why I want to do this is to create a list of classes that should be added to the List plugins when I start my application.</p>