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
char is not String. Declare R2D2 as char
char R2D2 = '';
To check vowel make a method like below and reuse this method at for loop and count the vowel occurrence:
static boolean isVowel(char ch) {
ch = Character.toLowerCase(ch);
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
return true;
}
return false;
}