i++ 或 ++i

基础几个9(评价系统的指标)

Arrays.aslist 的bug

方法做了重写

这样就能使用了

list的迭代器
不能使用list.remove方法。需要使用迭代器的remove方法

正确操作

Hashcode
hashcode是object对象的方法
是一个native方法
hashcode冲突案例和hashcode的计算过程
计算规则导致了hashcode的冲突

计算 "Aa" 和 "BB" 的哈希码
让我们逐步计算这两个字符串在Java中的哈希码:
"Aa" 的 hashCode:
hash = 0
第一个字符 A(Unicode 码值 = 65)
hash = 31 * 0 + 65 = 65
第二个字符 a(Unicode 码值 = 97)
hash = 31 * 65 + 97 = 31 * 65 + 97 = 2015 + 97 = 2112
因此,"Aa".hashCode() 的结果是 2112。
"BB" 的 hashCode:
hash = 0
第一个字符 B(Unicode 码值 = 66)
hash = 31 * 0 + 66 = 66
第二个字符 B(Unicode 码值 = 66)
hash = 31 * 66 + 66 = 31 * 66 + 66 = 2046 + 66 = 2112
因此,"BB".hashCode() 的结果也是 2112new的对象多了就会有hashcode冲突

integer 比较规则bug


BigDecimal比较规则bug




正确的建表和实体类

案例

科学计数法

List去重
方法1:新增1个list做存储

方法2:使用hashset方法

方法3:使用流式计算去重

方法4:遍历元素获取下标。下标不一致说明有2个值。










![[java基础-集合篇]LinkedBlockingQueue源码解析](https://i-blog.csdnimg.cn/direct/6d46ac338d844f7ea42b2990e8fe8a69.png)









