返回列表 發帖
  1. public class Ch34{
  2.        public static void main(String args[]){
  3.               String a[]={"禮","義","廉","恥"};
  4.               String b[]=new String[]{"忠","孝","仁","義"};
  5.               String c[];
  6.               c=new String[]{"梅","蘭","竹","菊"};


  7.               System.out.print("陣列a: ");
  8.               for(int i=0; i<4; i++)
  9.                       System.out.print(a[i]+" ");
  10.               System.out.println();
  11.               System.out.print("陣列b: ");
  12.               for(int i=0; i<4; i++)
  13.                       System.out.print(b[i]+" ");
  14.               System.out.println();
  15.               System.out.print("陣列c: ");
  16.               for(int i=0; i<4; i++)
  17.                       System.out.print(c[i]+" ");
  18.               System.out.println();
  19.        }
  20. }
複製代碼
ABCDEFGHIJKLMNOPQRSTUVWXYZ

TOP

返回列表