class Test04Base01 { public static void main(String[] args) { //整型 //byte byte b = 127; //short short s = 30000; //int int i = 1234567891; //long long l = 12345678910L; //??? long类型加L 否则int类型 //小数 浮点型 float f1 = 1.0001F; double d1 = 1.00012; //赋值 f1 = 1.000000000000000001F; System.out.println(f1); //企业真题 System.out.println(0.1 + 0.2);// 0.3 //浮点型 存取 IEEE 754标准,整数位 小数位 指数位 //测试2: float ff1 = 123123123F; float ff2 = ff1 + 1; System.out.println(ff1); System.out.println(ff2); System.out.println(ff1 == ff2); //== 比较 true //char //特点:单引号 一个字符 三种形式 字符 Unicode值 转义字符 //可以是数值 取值 和short一样 char c1 = 'a'; System.out.println(c1); char c2 = '\u0023'; System.out.println(c2); char c3 = '\t'; System.out.println(c3); //整数值 int c4 = c1; System.out.println(c4); //boolean boolean b1 = false; //条件判断 if(b1){ System.out.println("true"); }else{ System.out.println("false"); } // ( b1 = true ) 赋值 // ( b1 == true ) 没有意义 } }