【发布时间】:2011-11-25 09:18:37
【问题描述】:
可能重复:
Isn't it easier to work with foo when it is represented by the class ArrayList rather than the interface List?
Why are most of the examples using ArrayList
为什么我们大多这样做:
Map<Integer, String> map = new HashMap<Integer, String>();
而不是:
HashMap<Integer, String> map = new HashMap<Integer, String>();
& 在实例化 ArrayList(s) 时类似。
【问题讨论】:
标签: java collections