返回列表 發帖
  1. public class Ch34
  2. {
  3.     public static void main(String args[])
  4.     {
  5.       String a[]={"春","夏","秋","冬"};
  6.       String b[]=new String[]{"甲","乙","丙","丁"};
  7.       String c[];
  8.       c=new String[]{"東","南","西","北"};
  9.       System.out.print("陣列a: ");
  10.       for(int i=0; i<4; i++)
  11.          System.out.print(a[i]+" ");
  12.       System.out.println();   
  13.       System.out.print("陣列b: ");
  14.       for(int i=0; i<4; i++)
  15.          System.out.print(b[i]+" ");
  16.       System.out.println();
  17.       System.out.print("陣列c: ");
  18.       for(int i=0; i<4; i++)
  19.          System.out.print(c[i]+" ");
  20.     }
  21. }                              
複製代碼

TOP

返回列表