How can I compare two characters in Java?
while(s1.hasNext()) {
if(a[j].equals('x')
x++;
if(a[j].equals('y')
y++;
}
I have repeated the loop using for loop for n times and a[j] is an array. I am getting the error at if condition inside the while loop. Could anyone please explain me about the error?