當回傳值為Enumeration的型態時,該如何存取其值呢?
以下以NetworkInterface類別的getNetworkInterfaces函式說明。
此method可以取得系統上所有的網路介面以及所設定的IP位址。
它的回傳型態為static Enumeration
try {
Enumeration
while(e.hasMoreElements()) {
System.out.println(e.nextElement());
}
}
catch(Exception ex) {
ex.printStackTrace();
}
2007年7月15日 星期日
讀取Enumeration
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言