Annotations 注解
Comments 注释
Block comment 块
Line comment 行
JavaDos 文档注释 /** */
/** *@description (描述) *@Author (作者) */
primitive type 基本数据类型
整数类型:byte、short、int、long(long num = 30L;)
浮点类型:float(float num = 30.1F;)、double
布尔类型:boolean
字符类型:char
reference type 引用数据类型
类
接口
数组
进制:二进制0b 八进制0 十六进制0x
int i = 10;//十进制 int i1 = 0b10;//二进制 int i2 = 010;//八进制 int i3 = 0x10;//十六进制
银行业务怎么表示?
float 有限 离散 舍入误差 大约 接近但不等于
double
BigDecimal 数学工具类
float d = 0.1f; //0.1 double s = 1.0/10; //0.1 System.out.print(d==s); //false float num1 = 1213213123130f; double num2 = num1 + 1; System.out.print(d==s); //true
char 所有的字符本质还是数字,通编码(Unicode)表查找转换
char c = 'a'; System.out.print((int)c); //强制转换 c = 97;
转义字符 \t \n
boolean
boolean flag = true; if(flag){ System.out.print(flag); }