[蟲?] InputStream 在 for 迴圈
1.
for(int i=1;i<Integer.parseInt( in.readLine() );i++)
2.
String temp = in.readLine();
for(int i=1;i<Integer.parseInt(temp);i++)
請問上面兩個有什麼差別呢?
我使用1.的時候readLine都會讀到''
P.S.應該不是來源的問題,因為我換成2.就正常了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.129.25.20
※ WhenTheyCry:轉錄至看板 AndroidDev 05/16 14:10
→
05/16 14:35, , 1F
05/16 14:35, 1F
→
05/16 14:56, , 2F
05/16 14:56, 2F
→
05/16 15:07, , 3F
05/16 15:07, 3F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):