?? addinggroups.java
字號:
package chapter11;
import java.util.*;
public class AddingGroups {
public static void main(String args[]){
Collection<Integer> collection=new
ArrayList<Integer>(Arrays.asList(1,2,3));
Integer moreInts[]={4,5,6};
collection.addAll(Arrays.asList(moreInts));
Collections.addAll(collection, 111);
/*
* Collection添加的必須是一個Collection的一個實例
*
*/
for(Integer x:collection){
System.out.print(x+" ");
}
System.out.println();
List<Integer> list=Arrays.asList(22,23,24);
list.set(1, 10000);
/*
* 在這里修改第二個元素。
*/
for(Integer y:list){
System.out.print(y+" ");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -