JavaSE 静态初始化数组

JavaSE 静态初始化数组

package array;

public class ArrayDemo1 {
    public static void main(String[] args) {
            // 静态初始化定义数组
            // double[] scores = new double[]{99.5, 88.0, 75.8};
            double[] scores = {99.5, 88.0, 75.8};

            // int[] ages = new int[]{12,15,13};
            int[] ages = {12,15,13};

            // String[] names = new String[]{"Dean", "Jing", "Amy"};
            String[] names = {"Dean", "Jing", "Amy"};
    }
}

JavaSE 静态初始化数组
JavaSE 静态初始化数组
JavaSE 静态初始化数组
JavaSE 静态初始化数组

上一篇:JavaSE 参数传递机制 值传递和引用传递


下一篇:JavaSE学习笔记(Day4)