doc切换命令
doc切换命令:cmd D:\工作学习\java狂神说视频笔记
打开应用:
calc (打开计算器)
mspaint (打开画图工具)
notepad (打开txt文本)
Write Once 、 Run Anywhere
JDK:Java Development kit(java开发环境)
JRE:(java 运行环境)
JVM:(java 虚拟机)
int, long, short, byte, char, double, float, boolean
public static void main(String[] args) {
//TODO 整数拓展: 进制 二进制0b 十进制 八进制0 十六进制0x
int i = 10;
int i2 = 010; //TODO 八进制0
int i3 = 0x10; //TODO 十六进制0x 0-9 A-F(16)
int i4 = 0x11;
System.out.println(i); //TODO 10
System.out.println(i2); //TODO 8
System.out.println(i3); //TODO 16
System.out.println(i4); //TODO 17
System.out.println("==============================");
/**
* 浮点数扩展? 银行业务怎么表示?钱
* 用 BigDecimal 数字工具类 表示
*/
//TODO float 长度有限 离散的 含入误差 接近但不等于
//TODO double
//TODO 最好完全使用浮点数进行比较
float f1 = 0.1f; //0.1
double f2 = 1.0 / 10; //0.1
double f = 0.1; //0.1
System.out.println(f1 == f2); //false
System.out.println(f1 == f); //true
float f3 = 1222515632255121225f;
float f4 = f3 + 1;
System.out.println(f3 == f4); //true
System.out.println("==============================");
//TODO \n换行 \t空格
System.out.println("hello\nworld");
System.out.println("hello\tworld");
//TODO 字符拓展?
char c1 = '刘';
char c2 = '亮';
char c3 = '林';
System.out.println((int) c1); // 强制转换
System.out.println((int) c2);
System.out.println((int) c3);
System.out.println("==============================");
String s1 = new String("hello");
String s2 = new String("hello");
System.out.println(s1==s2); //false (原因是s1和s2内存地址不一样)
String s3 = "hello";
String s4 = "hello";
System.out.println(s3==s4); //true
System.out.println("==============================");
//TODO boolean布尔值扩展
boolean b1 = true;
if (b1) {
System.out.println("true");
}
}