Passing a string as a reference in Java?
<p>I don't think i have the terminology correct, haven't been one for that. What i'm trying to do is get a string back , then use it to run functions. .. Example :</p>

<pre><code>int slotNumber = ((j*3)+i+1);
String slotString = "slot"+slotNumber;
</code></pre>

<p>Regularly I can do this :</p>

<pre><code>slot12.Draw();
</code></pre>

<p>And I want to be able to do this :</p>

<pre><code>slotString.Draw();
</code></pre>

<p>With it substituting slotString with slot12 in a dynamic scenario. If i truly have to i could do something similar to :</p>

<pre><code>if (slotString == slot1) slot1.Draw();
if (slotString == slot2) slot2.Draw();
</code></pre>

<p>And such, but i dont really want to use x number of lines for x number of slots.</p>

<p>Any help is appreciated :D</p>
