简体   繁体   中英

ConcurrentHashMap occur value is null while values().iterator iterating

 ConcurrentHashMap map=buildMap();//init data
  Iterator<Object> iterator=map.values().iterator();
  while(iterator.hasNext()){
      Objetc data=iterator.next();//(1)
      System.out.println(data);
  }

can other Thread do something then make the (1)data is null?if can ,then how to do??

ConcurrentHashMap不允许将null作为键或值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM