更新时间:2022-04-06 22:36:48
Set
不是一个类,它是一个接口.
Set
is not a class, it is an interface.
所以基本上你只能实例化实现 Set
的类(HashSet
、LinkedHashSet
或TreeSet
)
So basically you can instantiate only class implementing Set
(HashSet
, LinkedHashSet
orTreeSet
)
例如:
Set<String> mySet = new HashSet<String>();