其他分享
首页 > 其他分享> > 多维数组&Array类&冒泡排序

多维数组&Array类&冒泡排序

作者:互联网

多维数组

image-20220724145904609

Array类

image-20220724152123199

import java.util.Arrays;

public class Dome003 {
    public static void main(String[] args) {
        int[]a={1,2,3,4,231,456,232};
        System.out.println(a);
        System.out.println(Arrays.toString(a));

    }
    public static void printArray(int[]a){
        for (int i = 0; i < a.length; i++) {
            if (i==0){
                System.out.println("[");
            }else {
                System.out.println(a[i]+",");

            }
        }
    }
}

import java.util.Arrays;

public class Array03 {
    public static void main(String[] args) {
        int[]a={1,2,3,4,231,456,232};
        Arrays.fill(a,2,4,0);
        System.out.println(Arrays.toString(a));
    }
}

冒泡排序

image-20220727142705833

标签:Arrays,System,冒泡排序,println,int,多维,Array,public,out
来源: https://www.cnblogs.com/csjg/p/16524747.html