Demo03

//浮点数拓展
float f = 0.1f;
double d = 1.0/10;
System.out.println(f);
System.out.println(d);
//==判断两数是否相等
//float 有限 离散 舍入误差 大约 接近但不等于
//double
//银行业务 钱用 BigDecimal 数学工具类 表示
//字符拓展
System.out.println("======================");
char c1 = 'a';
char c2 = '啊';
System.out.println(c1);

System.out.println((int)c1);//强制转换

System.out.println(c2);

System.out.println((int)c2);
//所有的字符本质上还是数字
//编码 Unicode 2字节 65536表(65=A 97=a) 早期的Excal 表格最长是2^16=65536
char c3 = '\u0061';

System.out.println(c3);
//转义字符
// \t 制表符
//\n 换行


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);
//对象 从内存分析
//布尔值拓展
boolean flat = true;
//if (flat==true){ }与if (flat){ }相等
posted @ 2021-02-05 16:56  主动  阅读(39)  评论(0)    收藏  举报