数组的定义(两种)
public class TestArray {
public static void main(String arg[]){
int[] list = {1,2,3,4,5,6};
int[] lists = new int[3];
int i;
lists[0] = 2;
lists[1] = 6;
lists[2] = 5;
for(i=0;i<list.length;i++){
System.out.println(list[i]);
}
}
}
public class TestArray {
public static void main(String[] args) {
double[] myList = {1.9, 2.9, 3.4, 3.5};
// 打印所有数组元素
for (double j: myList) {
System.out.println(element);
}
}
静,静,静