'Java Issues regarding code HS project "Bad Apples"

I keep getting a dereference error, I am still new to coding so if anyone could help me fix it, and explain why it didn't work, the goal of the code was to return how many strings in an array had a capital letter.

public int badApples(String[] apples)
{
    int holdo = 0;
    
    for(int i = 0; i < apples.length; i++)
    {
        for(int c = 0; c < apples[i].length(); c++)
        {
            if((apples[i].charAt(c)).isUpperCase)
            {
                holdo++;
            }
        }
    }
    
    return holdo;
    
}

Errors Received:

quicktest.java:19: error: char cannot be dereferenced
            if((apples[i].charAt(c)).isUpperCase)
                                    ^
quicktest.java:19: error: illegal parenthesized expression
            if((apples[i].charAt(c)).isUpperCase)
              ^


Solution 1:[1]

Errors like this are quite common if you don't use an IDE with autocompletion, syntax highlighting etc. Therefore I just give hints, so you can learn how to help yourself in similar problems in the future:

Try to find out, what type does (apples[i].charAt(c)) return. Is it an object, which class? (String?) Or is it a primitive like int, char, boolean?

At that point you get the error, you are trying to reference the member field isUpperCase. Does the returned type support it? Are you allowed to access it?

Sometimes there are so called utility methods of other classes that you can call to get information about the passed in parameter, like Character.isUpperCase().

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cyberbrain