10 2021 档案
摘要:理解HashMap先要理解HashCode HashCode HashCode 为什么使用 31 作为乘数? HashCode源码 // 获取 hashCode "abc".hashCode(); public int hashCode() { int h = hash; if (h == 0 &&
阅读全文
摘要:创建线程的四种方式 实现Runnable接口,重写run()方法(避免多继承局限) 继承Thread类,重写run()方法(本质:Thread类也是实现Runnable接口) 实现Callable接口,重写call()方法,有返回值 使用线程池(使用原因:不推荐手动创建线程,不方便管理,易造成较大开
阅读全文

浙公网安备 33010602011771号