Java compare char on string array
<p>Imagine I have a String array like this:</p>

<pre><code>String[][] fruits = {{"Orange","1"}, {"Apple","2"}, {"Arancia","3"};
</code></pre>

<p>If I do this:</p>

<pre><code>     for (int i = 0; i &lt; fruits.length;i++){
         System.out.println(fruits[i][0].charAt(1));
            }
</code></pre>

<p>it will print:</p>

<pre><code>r
p
r
</code></pre>

<p>And if I do this:</p>

<pre><code>     for (int i = 0; i &lt; fruits.length;i++){
         Character compare = fruits[i][0].charAt(1);
         System.out.println(compare.equals('r'));
            }
</code></pre>

<p>it will print:</p>

<pre><code>true
false
true
</code></pre>

<p>So here is my question. Is it possible to use charAt and equals on the same line, I mean, something like this:</p>

<pre><code>System.out.println((fruits[i][0].charAt(1)).equals("r"));
</code></pre>

<p>Regards,</p>

<p>favolas</p>
