iterating through Enumeration of hastable keys throws NoSuchElementException error

后端 未结 7 2390
梦谈多话
梦谈多话 2021-02-11 11:51

I am trying to iterate through a list of keys from a hash table using enumeration however I keep getting a NoSuchElementException at the last key in list?

Hasht         


        
相关标签:
7条回答
  • 2021-02-11 12:49

    Each time you do e.nextElement() you skip one. So you skip two elements in each iteration of your loop.

    0 讨论(0)
提交回复
热议问题