Re: [問題] 請問一個Collection的問題
回一下XD
改成:
while (it.hasNext()) {
Object temp = it.next();
if (temp instanceof String) {
String str = (String) temp;
System.out.println(str);
} else if (temp instanceof Integer) {
Integer integer = (Integer) temp;
System.out.println(integer);
}
}
就可以比了…
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.230.50.179
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):