發表文章

目前顯示的是 10月, 2022的文章

W3Schools 李建東 D11050135

//李建東2022.10.27.期中考準備資料型態 public class Main { /*宣告類別class Main存檔名Main.java*/ public static void main(String[] args) { String a=" 最小數 ", b=" 最大數 "; /*1位元組=8位元*/ String x1="位元數", x2="短整數", x3="整數", x4="長整數"; System.out.println(x1 + a + Byte.MIN_VALUE); /*位元數*/ System.out.println(x1 + b + Byte.MAX_VALUE); System.out.println(x2 + a + Short.MIN_VALUE); /*短整數*/ System.out.println(x2 + b + Short.MAX_VALUE); System.out.println(x3 + a + Integer.MIN_VALUE);/*整數*/ System.out.println(x3 + b + Integer.MAX_VALUE); System.out.println(x4 + a + Long.MIN_VALUE); /*長整數*/ System.out.println(x4 + b + Long.MAX_VALUE); } } style="background-color: white; clear: both; color: #757575; font-family: Roboto, sans-serif; font-size: 15px;"> 資料型態 長度(位元組) 記憶體 位元數byte 1位元組=8位元 bbbbbbbb 短整數short 2位元組=16位元 bbbbbbbb.bbbbbbbb 整數 4位元組=32位元 bbbbbbbb.bbbbbbbb.bbbbbbbb.bbbbbbbb 長整數 8位元組=64位元 bbbb...

W3schools學習Java雙迴圈,宣告整數int,字串String D11050135李建東

public class Main { /* 李建東2022/10/13德明C506教室 */ public static void main(String[] args) { int i; j; /* 宣告整數integer i, j */ String a="第", b="列: "; /*宣告字串 a, b且設定值 */ for (int i = 0; i