1public static void main(String[] args) throws Exception {
2 String word = "abcdefg";
3 System.out.println(word.length());
4 System.out.println(word.replace("a", "").length());
5 int a_counter = word.length() - word.replace("a", "").length();
6 System.out.println(a_counter);
7}