w3schools學習Java
w3schools學習Java程式碼
//劉任昌2022/11/11陣列array宣告,型態後面加[]
public class Main {
public static void main(String[] args) {
String[] cars = {"富豪","寶馬","福特","罵自答","撈屎來食"};
String[] classmates={"陳時中","獎萬安","黃珊珊","徐巧芯","雞排妹"};
int j = cars.length; /* 方法length得到陣列長度*/
for (int i=0; i j; i++) /* 迴圈列出我的汽車*/
System.out.println(cars[i]);
for (String i : cars) /* for-each loop迴圈列出我的汽車*/
System.out.println(i);
for (String i : classmates) /* for-each loop迴圈列出*/
System.out.println(i);
}
}
Java語言資料型態
- 資料型態分成原始型primitive與非原始型nono-primitive二大類
- 原始型primitive
- 布林boolean
- 位元數byte
- 短整數short
- 非原始型nono-primitive又稱為參照reference型態
- 字串String
- 陣列Array
- 類別Class
- 介面Interface
https://cindy-javascript.blogspot.com/2022/11/java.html
回覆刪除作者已經移除這則留言。
回覆刪除https://643gjeytfru4312.blogspot.com/2022/11/javaarrayfor-each-looplength
回覆刪除https://xdrcfvghyujiok8945656.blogspot.com/2022/11/javaarrayfor-each-looplength.html
回覆刪除https://d11150113.blogspot.com/2022/11/javaarray.html
回覆刪除https://d11150115.blogspot.com/2022/11/javaarrayfor-each-looplength.html
回覆刪除https://d11150116.blogspot.com/2022/11/javaarrayfor-each-looplength.html
回覆刪除https://iuytjhg5261.blogspot.com/2022/11/ul-background-colorlightyellow.html
回覆刪除https://rtytrdtfg.blogspot.com/2022/11/w3schools-20221111array-public-class.html
回覆刪除https://tgyhjikolujik2554.blogspot.com/2022/11/javaarrayfor-each-looplength.html
回覆刪除