数据类型
作者:互联网
public class HelloWorld {
public static void main(String[] args) {
//八大数据类型
//整数
int num1 = 10;
byte num2 = 20;
short num3 = 30;
long num4 = 30L; //L用于区分long类型
//小数:浮点数
float num5 = 10;
float num6 = 10.1F; //F float
double num7 = 3.1415926;
//字符
char name = 'T';
//字符串,【注】:String不是关键字,是类
String namea = "Tudou";
//布尔值
boolean flag = ture;
boolean Flag = false;
}
}
标签:String,float,数据类型,long,boolean,public 来源: https://www.cnblogs.com/ykxpc/p/16542775.html