1:“字节”是byte,“位”是bit ;
2: 1 byte = 8 bit ;
char 在java中是2个字节。java采用unicode,2个字节(16位)来表示一个字符。
short 2个字节
int 4个字节
long 8个字节
Posted xiaozhijing
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java中的char,short,int,long占几个字节相关的知识,希望对你有一定的参考价值。
1:“字节”是byte,“位”是bit ;
2: 1 byte = 8 bit ;
char 在java中是2个字节。java采用unicode,2个字节(16位)来表示一个字符。
short 2个字节
int 4个字节
long 8个字节
以上是关于java中的char,short,int,long占几个字节的主要内容,如果未能解决你的问题,请参考以下文章
Java中char,short,int,long占几个字节和多少位
java 变量数据类型转换?byte, short, char, int, long, float, double
JAVA 各种数值类型最大值和最小值 Int, short, char, long, float,&nbs
32位和64位系统,C语言中char,short,int,long,char*,int*,int**各占多少字节