?? foreachcollections.java
字號:
package chapter11;
import java.util.*;
public class ForEachCollections {
public static void main(String args[]){
Collection<String> cs=new LinkedList<String>();
Collections.addAll(cs, "In our lifetime, we will only be good friends!".split(" "));
for(String s:cs){
System.out.print(s+" ");
}
}
/*
*這個(gè)實(shí)例說明foreach不僅適用于數(shù)組,同樣適用于所用的Collection對象
*/
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -