I\'m not sure why I\'m getting this error. I think the code in general is okay although I\'m sure there is a shorter way then using all the else ifs. The problem is it says
String lineOne, R2D2 = "";
R2D2 is a string and you are comparing with a char if (R2D2== 'a'|| R2D2=='A')
try this
for (int i = word -1; i>= 0; i--) { R2D2= lineOne.charAt(i);
if (R2D2=="a"|| R2D2=="A")
count++;
else if (R2D2=="e"||R2D2=="E")
count++;
else if (R2D2=="o"|| R2D2=="O")
count++;
else if (R2D2=="u"||R2D2=="U")
count++;
else if (R2D2=="y"||R2D2=="Y")
count++;
}
One side not,you should compare using .equals()
instead of ==