为什么ids赋初始值用的是Collections.Emptylist() 而unitKeywords用的是new ArrayList()?
来源:5-17 推广单元限制服务功能实现(2)

幕布斯1199021
2023-02-14
老师您好,想问一下,为什么ids赋初始值用的是Collections.Emptylist() 而unitKeywords用的是new ArrayList()?
(是因为unitKeywords还需要有add()操作所以不能设置为Collections.Emptylist(),要是不需要add()操作就把它设置成Collections.Emptylist()吗? )
写回答
1回答
-
张勤一
2023-02-16
没有区别,正常使用就行
10
相似问题