public class CharToInt
  {
     public static void main(String args[])
       {
          int intResult  ,intVar=10;
          char  charVar='语';
          
          intResult=intVar+charVar;
 
          System.out.println("The char's Unicode is:"+Integer.toHexString(charVar));  //这是非曲直强制转换吗?
          System.out.println("The int value corresponding to the char is:"+new Integer(charVar).toString());  //最不理解的就是这个了,求解中…
       }
  } 结果:
 The char's Unicode is:  8bed
 The int value corresponding to the char is: 35831

解决方案 »

  1.   

    查一下JDK Documentation,很容易就知道上面两个方法怎么用了吧?
      

  2.   

    没有引制转换,只是输出一个值的十六进制而已.
    char 变量好像是保存这个字符的什么值吧.区位码还是别的什么的..
      

  3.   

    static String toHexString(int i) 
              以十六进制的无符号整数形式返回一个整数参数的字符串表示形式。 
    这个看API就可以了
      

  4.   

    System.out.println("The int value corresponding to the char is:"+new Integer(charVar).toString()); //这输出的是字符串35831
      

  5.   

    0x8bed=35821后面输出35821才对!(我试了)0x8bed应该是语字在Unicode中的编号
      

  6.   


    ...
    郑码: SBXJ  Unicode: 8BED GBK  D3EF
    笔画数: 9, 部首: 讠 笔画顺序: 451251251