public static void total() {
Scanner s = new Scanner("five six seven eight");
int num= 0;
for(int i=0; i < s.length; i++)
{
if(s.charAt(i).equals("a") || s.charAt(i).equals("b")
num++;
}
System.out.print(num);
}
public static void main(String[] args) {
total();
}
What am I doing wrong ?