What is wrong with the following code, which attempts to count the number occurrences of the letter

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 = 0; for (int i = 0; i < s.length (); i++) { if (s.charAt (i).toLowerCase () 'e') { %3D%3D count++; }

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: