Yes, if you first convert the result of charAt() to Character :
System.out.println(Character.valueOf(fruits[i][0].charAt(1)).equals('r'));
A simpler version is to write
System.out.println(fruits[i][0].charAt(1) == 'r');
I personally would always prefer the latter to the latter.
The reason your version does not work is because charAt() returns char (unlike Character ), and char , being a primitive type, does not have an equals() method.
Another mistake in your code is the use of double quotes in equals("r") . Unfortunately, this one will compile and can lead to a painful debugging session. With the char based version above, this will be detected at compile time.
source share