X987: Count 'a's in String

The method below should take in a string as a parameter and return an int representing the number of lower case 'a's there are in the String.

For example,

  • If "cat" was the string, this method would return 1.
  • If "aaaa" was the string, this method would return 4.
  • If "bebop" was the string, this method would return 0.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.