I need to count occurrences of a character in a string that is passed in the command line. For example, if we pass a sentence "the bread was wet", and we are looking for occurrences of the character "e", the program should output the occurrences of "e" per word: 1 1 0 1 .

I am new to Java, and what I came up with doesn't work:

```
    public static void main(String[] args) {
        int count = 0;
        for (int i = 0; i < args.length; i++) {
            // System.out.println(args[i]+" ");
            if (args[i].charAt(i) == 'e') {
                count++;

            }
            System.out.println(count);
        }
    }

```

Obviously, args[i].charAt(i) is wrong here because it is looking at the 1st letter of the 1st word, as it seems. However, args.charAt(i) doesn't even work.
I am not sure how to fix this and get the correct output.