请问为什么把基本类型char型称作numeric型?

解决方案 »

  1.   

    The primitive types (¡ì4.2) are the boolean
    type and the numeric types. The numeric types are the integral types byte, short,
    int, long, and char, and the floating-point types float and double.
    这是从SUN官方网站下载的《java language specification》上写的
    不明白,难道char是数值型的类型吗?
      

  2.   

    当然了,char的范围是0~65535,也就是Unicode的\u0000~\uffff,每一个值表示一个Unicode字符。
      

  3.   

    我这样
    char c='a';
    char d='b';
    System.out.println(c+d);
    似乎我定义了两个字符类型
    而实际是ascii码相加 =195
    这个很拗口,和别的语言不一样
    我希望打印出'ab'
    看来用char是不行的了
    这个char有什么实际意义吗
      

  4.   

    是的,char实际上是类似整型的,不能按照string的方式处理
      

  5.   

    上面的引号之间不要加空格,CSDN莫名其妙地给加上去了,真是自作多情~~~