看板
[ java ]
討論串[問題] 請問有關for的使用問題
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
JDK5 新加的語法.. for (T a: b) {. // do something. }. 當 b 為 Collection<T> 或 T[] 時可以這樣寫.. Collection<T> 的情況其實 compiler 為你轉為:. for(Iterator<T> itr=b.iterator
(還有115個字)
內容預覽:
這是類foreach的寫法. 也是 since 1.5 的feature. for(<type> tokenName:<Collection>){. }. 會從第一個開始列舉Collection裡面的element. 比方說. String[] strAry={"1","2","3","4"};.
(還有429個字)
內容預覽:
public class Main. {. private enum Seasons { winter, spring, summer, fall }. public static void main(String[] args). {. for (Seasons s : Seasons.value
(還有84個字)
首頁
上一頁
1
下一頁
尾頁