在Java中Set只不过是Map的Wrapper类,所以要获取ConcurrentHashSet只需要:
Set<String> names = Collections.newSetFromMap( new ConcurrentHashMap<String, Boolean>() );
在Java中Set只不过是Map的Wrapper类,所以要获取ConcurrentHashSet只需要:
Set<String> names = Collections.newSetFromMap( new ConcurrentHashMap<String, Boolean>() );