看板 java 關於我們 聯絡資訊
底下我自己寫了一個小的程式(有關於hashtable的程式) 不知道為什麼會有NoSuchElementException發生 有人可以解說一下嗎,,,謝謝!! import java.util.*; public class Main { public static void main(String[] args) { try{ Hashtable ht = new Hashtable(); ht.put("key1","E1"); ht.put("key2","E2"); ht.put("key3","E3"); Enumeration ek=ht.keys(); Enumeration ev = ht.elements(); while(ek.hasMoreElements()) { System.out.println((String)ev.nextElement()); } } catch ( NoSuchElementException e1) { System.out.println("Exception happens" ); } finally { System.out.println("ok") ; } } } -- ┌─────KKCITY─────┐─┐ 優質連線服務///!! bbs.kkcity.com.tw └─ KKADSL 帶你環遊全世界 └──From:220.143.231.122 ──┘ KKADSL http://adsl.kkcity.com.tw --