public class test3 {
public static void main(String[] args) {
// 进制 二进制0b 十进制 八进制0 十六进制0x
int i = 10;
int i2 = 010;
int i3 =0x10;
System.out.println(i);
System.out.println(i2);
System.out.println(i3);
System.out.println("=====================");
//浮点数拓展 float表现的字长是有限的 离散 舍入误差 大约数 接近但不等于
//最好完全避免使用浮点数比较
float s = 0.1f;
double s1 = 1.0/10;
System.out.println(ss1);
System.out.println("=");
float s2 = 1212121212112f;
float s3 = s2 + 1;
System.out.println(s2s3);
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 编码
System.out.println("=================");
char c3 = '\u0066';
System.out.println(c3);
//转义字符
// \t 制表符
// \n 换行符
System.out.println("hello\nworld");
}
}
标签:float,Java,int,知识,System,拓展,char,println,out From: https://www.cnblogs.com/lzy599024/p/18060724