use variable with "new" when creating object
<p>I am designing a virtual aquarium.  I have a class: Fish which I inherit to create classes of different species.  The user can select the species in a combo box and click a button to put the fish in the tank.  I use the following code to create the fish:</p>

<pre><code>    switch(s){
        case "Keegan" :
            stock.add(new Keegan(this, x,y));
            break;
        case "GoldenBarb" :
            stock.add(new GoldenBarb(this, x,y));
</code></pre>

<p>"stock" is a LinkedList and "s" is the String selected in the Jcombobox.  As it stands I will have to create a long switch when I add a bunch of different species.  I would like the code to look like:</p>

<pre><code>stock.add(new s(this,x,y));
</code></pre>

<p>and dispense with the switch such that all I have to do is create the class and add its name to the combo box and have it work.  Is there a way to do so?  Any help is appreciated.</p>
