首页 > 代码库 > java中打印输出数组

java中打印输出数组

import java.util.Arrays;
public class ArrayDemo
{
    public static void main(String[] args) {
        int size = 4; // 数组大小
        int[] myList = new int[size];// 定义数组
        myList[0] = 5;
        myList[1] = 12;
        myList[2] = 33;
        myList[3] = 52;
        System.out.println(Arrays.toString(myList));
    }
}

 

java中打印输出数组