//八大数据类型;
//整数:
byte num0=127;
int num1=1;//最常用
short num2=22222;
long num3=2020L;//需要用L 来表示Long 类型
//小数:浮点数:
float num4=4.4F;//浮点数需要在数据后面+L;
double num5=44.4213123123;
//字符:
char name=‘强‘;
String fullname="李润强";//String 不是字符串,是类来的:
//布尔值:
boolean value=true;
//整数拓展: 进制,二进制0b,十进制,八进制0,十六进制0x
int i=10;
int i2=0171;
int i3=0x10;
System.out.println(i);
System.out.println(i2);
System.out.println(i3);
//浮点型拓展,银行业务,钱
//float
//double
float f=0.1f;
double d=1.0/10;
System.out.println(f==d);
System.out.println("=================================");
//转义字符
// \t 制表符
// \n 换行
System.out.println("hello \n wodiaoni");
System.out.println("=================================");
String sa=new String("hello world!");
String sb=new String("hello world!");
System.out.println(sa==sb);
String sc="hello world!";
String sd="hello world!";
System.out.println(sc==sd);
System.out.println("=================================");
//
原文:https://www.cnblogs.com/tyrion-Lee/p/15056839.html