数组的动态初始化

动态初始化

数据类型数组名[][;

数组名=new数据类型[行的个数][列的个数];

如:

public class set0926 {
    public static void main(String[] args){
        float[]a1=new float[6];
        System.out.println(a1[0]);
        a1[0]=100;
        System.out.println(a1[0]);
        System.out.println(a1);
    }
}

运行结果:

0.0

100.0

[F@776ec8df

原文地址:https://www.cnblogs.com/yhcTACK/p/15341090.html