数据类型  

基本数据类型数值型整型byte/short/int/long 
浮点型/double/float 
字符型char  
布尔型boolean取值true  false 
   
对象数据类型类Class  
接口 interface  
数组array[]   
类型 对象位数字节数最小值最大值

byte    

Byte      8       1       -128=2^7        127=2^7-1         

short

Short162 -32768=2^1532767=2^15-1

int

Integer324-2147483648=2^312147483647=2^31-1

long   

Long648-9223372036854775808=2^63              9223372036854775807=2^63-1

float  

Float3242^-149(2-2^-23)^127

double

Double6482^-1074(2-2^-52)^1023

char  

Character    

字符型:

  字符编码  ASCII (American Standard Code Information Interchage)

      Unicode (统一码 java所采用的编码)

数据也有对象

int类型的对象 Integer

方法主要有:toString() 转换为String类型;

      valueof()字符型转换为int型

还有Float  Double  等对象。

java中的常量

前加上 final  而且定义后只能赋一次值

04-20 21:40
查看更多