Looping through variables in JAVA
<p>It is possible to loop through variables of primitive type char (using say a foreach loop)?</p>

<p>I have three characters</p>

<pre><code>char char1 = 'A';
char charTest = 'P';
char character = 'R';
</code></pre>

<p>Currently I have a long list of "if" statements applied to char1:</p>

<pre><code>if (char1 == 'A')
doSomething;
else if (char1 == 'K')
doSomethingElse;
else if (charPrev == 'G')
    doSomethingAgain;
else
    doSomethingYetAgain;
</code></pre>

<p>However, I will be applying the same set of "if" statements to other character variables (in this example charTest and character).</p>

<p>What is a simply way to accomplish this? Thanks for any input!</p>
