Determining the Unicode category for a particular character

Try the static method Character.getType.

Main.java:

public class Main {
   public static void main(String args[]) {
      System.out.println(Character.getType('D'));
      System.out.println(Character.getType(' '));
      System.out.println(Character.getType(')'));
      System.out.println(Character.getType('1'));
      System.out.println(Character.getType('-'));
   }
}

outputs:

1	(UPPERCASE_LETTER)
12	(SPACE_SEPARATOR)
22	(END_PUNCTUATION)
9	(DECIMAL_DIGIT_NUMBER)
20	(DASH_PUNCTUATION)