作者TonyQ (骨头)
看板java
标题Re: 关於NoSuchElementException的问题
时间Sat Apr 14 20:31:02 2007
※ 引述《[email protected] (无言)》之铭言:
: 底下我自己写了一个小的程式(有关於hashtable的程式)
: 不知道为什麽会有NoSuchElementException发生
: 有人可以解说一下吗,,,谢谢!!
: while(ek.hasMoreElements())
只要你没有执行 ek.nextElement() 这个判断式就不会更新。
而且可能不能肯定ek的顺序一定会跟ev的顺序一样。
如果你只是想把value列表 那你要把ek换成ev
: {
: System.out.println((String)ev.nextElement());
: }
--
I am a person, and I am always thinking .
Thinking in love , Thinking in life ,
Thinking in why , Thinking in worth.
I can't believe any of what ,
I am just thinking then thinking ,
but worst of all , most of mine is thinking not actioning...
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.134.27.68