二进制(0b开头)
十进制
八进制(0开头)
十六进制(0x开头) 0-9 A-F(F:16)
int i=10;//十进制
int i2=010;//八进制0
int i3=0x10;//十六进制0x 0-9 A-F(F:16)
System.out.println("十进制"+i); //10
System.out.println("八进制"+i2);//8
System.out.println("十六进制"+i3);//16
char c1=‘A‘;
char c2=‘中‘;
System.out.println(c1);
System.out.println((int)c1);//强制转换字符型可得到对应的Unicode数字编码
System.out.println(c2);
System.out.println((int)c2);//强制转换字符型可得到对应的Unicode数字编码
char c3=‘\u0061‘;
System.out.println(c3); //a
// \t制表符
// \n回车
// \r换行
// \f换页
// \‘单引号
// \"双引号
// \\反斜杠
// \b推格
// \d八进制
// \xd十六进制
// \ud Unicode字符
System.out.println("Hello\tWorld");
String sa=new String("hello world");
String sb=new String("hello word");
System.out.println(sa==sb);//false
String sc="hello world";
String sd="hello world";
System.out.println(sc==sd);//true
boolean flag = true;
if(flag){}
//less is more 代码要精简易读
原文:https://www.cnblogs.com/qwblogs/p/15228218.html