基本数据类型:
四类八种:
整数型:byte、short、int(默认)、long(后加L或者l);整数
浮点型:float(后加F或者f)、double(默认);小数
字符型:char 例如 :‘a’;
布尔型:boolean 分为true和false;
public class test{
public static void main(String[] args){
byte b1 =10;
System.out.println(b1);
short s1 = 1000;
System.out.println(s1);
int i1 =1000000;
System.out.println(i1);
long l1 = 12345678999l;
System.out.println(l1);
float f1 = 1.2F;
System.out.println(f1);
double d1 = 502.32;
System.out.println(d1);
char c1= ‘a’;
System.out.println(c1);
boolean b2 = true;
System.out.println(b2);
}
}
基本数据类型
最新推荐文章于 2020-11-19 21:19:54 发布