第四章数组学习

一维数组

package java_study.week4;

public class Arr {
public static void main(String[] args) {
String class1[] = {
"张三","李四","王五","赵六"
};
System.out.println("此班级有"+class1.length+"人" );
}
}

二维数组

public class Arrays {

public static void main(String[] args) {
    
    
    char arr[][]=new char[4][];   /
    arr[0]=new char[]{'床','前','明','月','光'};
    arr[1]=new char[]{'疑','是','地','上','双'};
    arr[2]=new char[]{'举','头','望','明','月'};
    arr[3]=new char[]{'低','头','思','故','香'};
    System.out.println("---横版---");
    for(int i=0;i<4;i++){
        for(int j=0;j=0;i--){
            System.out.print(arr[i][j]);
        }
        
        System.out.println();
    }
System.out.println(",。,。");

}

}

冒泡排序

image.png

你可能感兴趣的:(第四章数组学习)