What is the best way to tell if a character is a letter or number in Java without using regexes?

To tell if a character is a letter or number in Java without using regexes, you can use the Character class and its isLetter() and isDigit() methods.

Here's an example of how you can use these methods to check if a character is a letter or number:

char c = 'A';

if (Character.isLetter(c)) {
  System.out.println(c + " is a letter");
}

if (Character.isDigit(c)) {
  System.out.println(c + " is a number");
}

This will print the following output:

A is a letter

You can also use the isLetterOrDigit() method to check if a character is a letter or a digit:

char c = 'A';

if (Character.isLetterOrDigit(c)) {
  System.out.println(c + " is a letter or a number");
}

This will print the following output:

A is a letter or a number

I hope this helps! Let me know if you have any questions.