Why does this code sometimes throw a NullPointerException?

前端 未结 3 869
独厮守ぢ
独厮守ぢ 2021-01-13 21:13

Consider the following Java source:

if( agents != null ) {
  for( Iterator iter = agents.keySet().iterator(); iter.hasNext(); ) {
    // Code that uses iter.         


        
3条回答
提交回复
热议问题