今天还是概念较多,操作技术较少,但是记忆点挺多。不小心瞅了眼弹幕,发现联想记忆是真的绝啊!
了解了一下数据类型,分为二大类,一是基础数据类型,二是引用数据类型;
基础类是四类八种
四类是 整数、浮点数、字符、布尔
八种是int(默认);byte;short;long;float;double;char;boolean;其long和float需要分别加上那个后缀L和F。
今天的实操,往下看
public class VariableDemo3{
//主入口
public static void main(String[] args){
//byte
byte a=10;
System.out.println(a);
//short
short b=20;
System.out.println(b);
//int
int c=50;
System.out.println(c);
//long
long d=60L;
System.out.println(d);
//float
//定义float类型变量的时候,也需要加一个F做后缀
float f=11.1F;
System.out.println(f);
//double
double e=12.2;
System.out.println(e);
//char
char h='中';
System.out.println(h);
//boolean
boolean q=true;
System.out.println(q);
}
}