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个字节

posted @ 2018-01-16 11:59  带刺的小花277  Views(7801)  Comments(0Edit  收藏  举报