Can the char type be categorized as an integer?

前端 未结 8 2617
盖世英雄少女心
盖世英雄少女心 2020-12-01 22:32

Just now I read \"char is the only unsigned integral primitive type in Java.\" Does this mean the char is one of the integral types in Java?

Same as in C, recently I

8条回答
  •  执念已碎
    2020-12-01 23:26

    The C specification calls for the char type to be implemented as a 1-byte integer. The specifications for other types are not always so clear. For example, the original Kernigan and Ritchie C book said that, as far as short and long were concerned, among different implementations, you could only rely on the fact that short was no longer than long.

提交回复
热议问题