可以将char类型归类为整数吗? [英] Can the char type be categorized as an integer?

查看:289
本文介绍了可以将char类型归类为整数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚才我读到char是Java中唯一的无符号整数基本类型。
这是否意味着char是Java中的一个整数类型?

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?

与C相同,最近我读过C类型包括标量类型,函数类型,联合类型,聚合类型和标量类型包括指针类型和算术类型,则算术类型包括整数类型和浮点类型,整数类型包括枚举类型和字符类型。

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.

可以在Java和C中将char类型归类为整数吗?

Can the char type really be categorized as a integer both in Java and C?

推荐答案

是的, char 它出现的语言。 积分意味着其谱是离散的,并且任何两个不同值之间的最小差是 1 。与其他整数类型相比,支持的值的所需范围通常相当小。计算机硬件传统上将整数视为基本数据类型;相反,算术浮点类型是一个更新的和更复杂的添加。

Yes, a char is 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 is 1. 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.

这篇关于可以将char类型归类为整数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆