Question: What is wrong with the following code, which attempts to count the number occurrences of the letter 'e' in a String , case-insensitively? int count
What is wrong with the following code, which attempts to count the number occurrences of the letter 'e' in a String , case-insensitively?

int count = 0; for (int i = 0; i < s.length (); i++) { if (s.charAt (i).toLowerCase () 'e') { %3D%3D count++; }
Step by Step Solution
3.50 Rating (173 Votes )
There are 3 Steps involved in it
The toLowerCase method cannot be called on a char value which is what the cha... View full answer
Get step-by-step solutions from verified subject matter experts
