当前位置:首页>维修大全>综合>

List Integer intList new ArrayList Integer Arrays.asList 0 1 2 3 4 5 这句话什么意思(arraylist的扩容因子为啥是0.75)

List Integer intList new ArrayList Integer Arrays.asList 0 1 2 3 4 5 这句话什么意思(arraylist的扩容因子为啥是0.75)

更新时间:2025-05-25 17:14:30

List Integer intList new ArrayList Integer Arrays.asList 0 1 2 3 4 5 这句话什么意思

表示了List里面放的对象是什么类型的,这样写就表示了,你List里面放的必须是Integer类型的,别的就会报错,所以,你可以先Integer it = new Integer();list.add(it);这样就相当于再list里面放入了一个Integer对象,你要放别的就不行了,懂了?

更多栏目