难道说字符不能转换为数字,而数字可以转换为字符?

解决方案 »

  1.   

    你定义的是char型,字符转数字是自动转型,数字转字符需要强制转型。
      

  2.   

    c定义的就是A啊,c1才是65.
      

  3.   

    char c='A'
    System.out.println(c);就是输出
    System.out.println('A');
      

  4.   

    隐式转换,都能转。只是有是否损失精度的问题 char c = 'a';
    System.out.println(c);
    char c1 = 66;
    System.out.println(c1);
    int c2 = 'f';
    System.out.println(c2);