//陳冠辰2022.11.7.陣列=順序的同型資料

public class Main { 

  public static void main(String[] args) { 

    String[] hey = {"富豪","法拉利","藍寶堅尼","保時捷","賓士"}; 

    /*宣告字串陣列,[]代表陣列,名稱hi"/

    /*方法length陣列的長度*/

    System.out.println("陣列長度"= + hi.length);

    for (int i = 0;i<hi.length;i++)

    System.out.println(hi[i]);

  } 

}



留言

這個網誌中的熱門文章

陳冠辰類別class __init__(self, 其他參數) 6月 05, 2023