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 have read that C types includes scalar types, function types, union types, aggregate types, and scalar types include pointer types and arithmetic types, then arithmetic types include integral types and floating-point types, the integral types include enumerated types and character types.
Can the char type really be categorized as a integer both in Java and C?
Yes, a
charis an integral type in all the popular languages in which it appears. “Integral” means that its spectrum is discrete and the smallest difference between any two distinct values is1. The required range of supported values is usually quite small compared to that of other integral types. Computer hardware traditionally treats integers as the fundamental data type; by contrast, arithmetic floating-point types are a more recent and more complicated addition.