java基础知识
1. JDK、JRE、JVM

2. java关键字
abstract assert boolean break byte
case catch char class const
continue default do double else
enum extends final finally float
for goto if implements import
instanceof int interface long native
new package private protected public
return short static strictfp super
switch synchronized this throw throws
transient try void volatile while
3. 数据类型
1. java属于强类型语言(变量使用严格符合规定),优点安全,缺点速度慢
2. 数据类型分为基本类型 和引用类型
2.1基本类型:(Demo02)
- 数值类型
- 整数类型
- byte(1字节)
- short(2字节)
- int(4字节)
- long(8字节)
- 浮点类型
- float(4字节)
- double(8字节)
- 字符类型
- char(2字节)
- 整数类型
- 布尔类型
- true(1位)
- false(1位)
2.2基本类型扩展
- 整数拓展
- 二进制0b
- 十进制
- 八进制0
- 十六进制0x
- 浮点数拓展
- float 和double 不能精确计算
- 精确计算可使用BigDecimal
- 字符拓展
- 字符可转化为数值类型
- 转义字符
- \t 制表符
- \n 换行符
3. 变量命名规范
- 所有变量、方法、类名:"见名知意"
- 类成员变量:首字母小写和驼峰原则:monthSalary
- 局部变量:首字母小写和驼峰原则
- 常量:大写字母和下划线:MAX_VALUE
- 类名:首字母大写和驼峰原则:Man,GoodMan
- 方法名:首字母小写和驼峰原则:run(),runRunO
浙公网安备 33010602011771号