Character.getNumericValue() issue
问题 I'm probably missing something, but why are the two numeric values equal to -1 ? System.out.println(Character.getNumericValue(Character.MAX_VALUE)); System.out.println(Character.getNumericValue(Character.MIN_VALUE)); Returns: -1 -1 回答1: getNumericValue() will convert characters that actually represent numbers (like the "normal" digits 0-9, but also numerals in other scripts) to their numeric value. The Characters represented by Character.MAX_VALUE and Character.MIN_VALUE do not have such a