
Zachary A. answered 07/20/20
A passionate computer science tutor with industry experience!
In Java, single quotes (') are used for character literals. In your above code snippet, you define Person as taking a gender argument, which you specify as type char (presumably being something like 'M', 'F', 'T'). However, you pass in 'female', which is not a single character, and thus cannot be enclosed by single quotes.
For future reference, the up carat doesn't always point to the exact point in that line where the error was thrown (which I imagine is what lead to your confusion).
Ashley P.
Thank you very much for the explanation!07/20/20