靜態動態陣列

whoiszqy發表於2024-11-28

package array;

public class Demo02 {
public static void main(String[] args) {
//靜態
int[] a = {1,2,3};
int[] b = new int[3];
b[0]=5;
b[1]=6;
b[2]=7;

    System.out.println(a[0]);
    System.out.println(b[0]);
    System.out.println(a[2]);

}

}

相關文章