Recursion explained with examples[
^]
The trick is to check the character if it is a
int
or
char
or something else.
You can accomplish the given task by trying to convert the character into a int - a NumberFormatException will appear if it is not a int. I think this is what your teacher has in mind.
Other solution (more elegant): convert the character into a int and check if it is within the range (
ANSI Printable Characters[
^] of a letter. Check the "Dec" (decimal) column on this table for reference.