莊俊祥,陣列array使用迴圈輸出

//莊俊祥2022.11.7.陣列=順序的同型資料 public class Main { public static void main(String[] args) { String[] wow = {"富豪", "寶馬", "福特", "馬自達","勞駛來食"}; /*宣告字串陣列,[]代碼陣列,名稱wow*/ /*方法 length 陣列的長度,使用迴圈列出所有我的汽車*/ System.out.println("陣列長度="+wow.length); for ( int i= 0; i < wow.length; i++) System.out.println( wow[i]); } }

留言

這個網誌中的熱門文章

莊俊祥python,print,input,字串[::-1]

莊俊祥Python視窗GUI自訂方法canvas.delete('all')

莊俊祥python集合set元組tuple清單或串列list迴圈輸出str,int