- public class Ch10 {
- public static void main(String[] args) {
- String a[]={"春","夏","秋","冬" };
- String b[]={"甲","乙","丙","丁" };
- int c[]={1,2,3,4};
- String d[]={"A","B","C","D" };
- System.out.print("a陣列為 ");
- for(int i=0;i<4;i++){
- System.out.print (a[i]+" ");
- }
- System.out.println();
- System.out.print("b陣列為 ");
- for(int i=0;i<4;i++){
- System.out.print (b[i]+" ");
- }
- System.out.println();
- System.out.print("c陣列為 ");
- for(int i=0;i<4;i++){
- System.out.print (c[i]+" ");
- }
- System.out.println();
- System.out.print("d陣列為 ");
- for(int i=0;i<4;i++){
- System.out.print (d[i]+" ");
- }
- }
- }
複製代碼 |