且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法实例化类型 Set

更新时间:2022-04-06 22:36:48

Set 不是一个类,它是一个接口.

Set is not a class, it is an interface.

所以基本上你只能实例化实现 Set 的类(HashSetLinkedHashSetTreeSet)

So basically you can instantiate only class implementing Set (HashSet, LinkedHashSet orTreeSet)

例如:

Set<String> mySet = new HashSet<String>();