1.3 KiB
1.3 KiB
- StringBuilder
- StringBuffer
- Arrays
- System
- Runtime
- Math
- Random
- UUID
- BigDecimal
- 总结
collapsed:: true
- StringBuilder
- 长度,内容可变的字符串
- 常用API
- append
- insert
- capacity
- length
- setCharAt
- deleteCharAt
- delete
- reverse
- substring
- indexOf
- lastIndexOf
- StringBuffer
- 所有API及操作与StringBuilder一致
- Arrays
- toString
- sort
- binarySearch
- copyOf
- equals
- System
- exit
- gc
- currentTimeMillis
- nanoTime
- arraycopy
- getProperties
- Runtime
- Math
- random
- abs
- pow
- max
- min
- round
- Random
-
Random a = new Random(); - 回溯历史
- Random(long seed)
-
- {{embed UUID}}
- BigDecimal
- 解决浮点数精度丢失的问题
- 使用字符串作为参数最精准
- 加减乘除
- add
- subtract
- multiply
- divide
- 除法除不尽
- 收尾
- ROUND_DOWN 去尾
- 只保留小数点后指定位数
- ROUND_UP 收尾
- 保留小数点后指定位数,如果保留位的后一位不为零,保留位的值加1
- ROUND_HALF_UP 四舍五入
- 保留小数点后指定位数,如果保留位的后一位<5,保留位数的值不加1,保留位的后一位>=5,保留位数的值加1
- ROUND_DOWN 去尾
- 收尾
- StringBuilder