int a=10; 十进制
int a1=010; 八进制
int a2=0x10; 十六进制
System.out.println(i);
System.out.println(i1);
System.out.println(i2);
System.out.println("==========================");
float a=0.1f;
double b=1.0/10;
System.out.println(a==b);
答案是:false,有误差
char=‘a‘;
char=‘中‘
System.out.println(c1);
System.out.println((int)c1);
System.out.println(c2);
System.out.println((int)c2);
// \t 制表符
System.out.println("Hello\tworld");
// \n 换行
System.out.println("Hello,\nworld");
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);
boolean flag=true;
if (flag==true){}
if (flag){}
这两个是一样的
原文:https://www.cnblogs.com/husai520/p/12871366.html