System.out.println(Character.getNumericValue('A'));
为什么无论是大写A或小写a都是返回为10 ?

解决方案 »

  1.   

    什么是BCD码哦?
    ls的能不能详细介绍下哦~~
    先谢谢啦~~~
    嘿嘿~
      

  2.   

    getNumericValuepublic static int getNumericValue(char ch)    Returns the int value that the specified Unicode character represents. For example, the character '\u216C' (the roman numeral fifty) will return an int with a value of 50.    The letters A-Z in their uppercase ('\u0041' through '\u005A'), lowercase ('\u0061' through '\u007A'), and full width variant ('\uFF21' through '\uFF3A' and '\uFF41' through '\uFF5A') forms have numeric values from 10 through 35. This is independent of the Unicode specification, which does not assign numeric values to these char values.    If the character does not have a numeric value, then -1 is returned. If the character has a numeric value that cannot be represented as a nonnegative integer (for example, a fractional value), then -2 is returned.    Note: This method cannot handle supplementary characters. To support all Unicode characters, including supplementary characters, use the getNumericValue(int) method. Java文档如是说
      

  3.   

    它已经说了A-Z以及a-z,将返回数值10-35,这与Unicode规范无关,因为Unicode标准并没有
    给这些字符赋予数值