Re: [問題] 請問一個Collection的問題

看板java作者 (Reder)時間17年前 (2008/07/03 01:39), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
回一下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
文章代碼(AID): #18QxrjD8 (java)
文章代碼(AID): #18QxrjD8 (java)