發表文章

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

徐珮芸Java資料型態練習

圖片
挪威w3schools.com練習Java code截圖 /*徐珮芸2022/10/24Java變數Variables資料type型態*/ public class Main { public static void main(String[] args) { int i; /*註解java, JavaScript, CSS*/ int myNum = 5; //宣告整數integer(whole number) float myFloatNum = 5.99f; //宣告浮點數floating point number, 4 bytes=32 bits,4位元組 char myLetter = '龍'; //宣告字元character, 2 bytes=16 bits,2位元組 boolean myBool = true; //宣告布林boolean, 1 bit,1位元 String myText = "徐珮芸"; //宣告字串String i = myLetter; //整數i=字元'龍' System.out.println(myLetter + "字碼unicode 10進位" + i); System.out.println(myNum); System.out.println(myFloatNum); System.out.println(myLetter); System.out.println(myBool); System.out.println(myText); } } Java原型primitive 資料型態,撰寫模式貼上 資料型態 長度(位元組) 範圍最小 範圍最大 位元數 1位元組=8位元 -128 127 短整數 2位元組=16位元 -32,768 32,767 整數 4位元組=32位元 -2,147,483,648 2,147,483,647 長整數 8位元組=64位元 -9,223,372,036,854,780...

徐珮芸w3schools,Java雙迴圈,int整數,String字串,+串接,運算子operator

圖片
Java程式碼 /*徐珮芸2022/10/17w3schools學雙迴圈*/ public class Main { public static void main(String[] args) { int i, j; /*宣告整數integer變數i, j*/ String a="第", b="列:"; /*宣告整數字串a, b給初始值*/ for ( i = 8; i /* CSS的註解方式和Java,定義h1的風格 */ h1{border: blue solid 10px; padding: 20px; background-color: pink; color: gray; text-align: center; border-radius: 30px;} 老師示範,利用Character.toString學習UNICODE萬國碼, 統一碼 /*徐珮芸2022/10/17w3school學雙迴圈*/ public class Main { public static void main(String[] args) { int i, j; /* 宣告整數integer變數i, j*/ String a="第",b="列:"; /* 宣告整數字串a,b給初始值*/ for (i = 8; i > 0; i--) { /*迴圈*/ System.out.print(a + i + b);/*+運算子用在字串,串接功能*/ for (j = 0; j /* CSS的註解方式和Java,定義h1的風格 */ h1{border: blue solid 10px; padding: 20px; background-color: pink; color: gray; text-align: center; border-radius: 30px;} 程式碼截圖

w3schools範例製作台灣平均每人GDP和西元年關係

台灣平均每人GDP與西元年關係 w3schools範例:房價與面積 學習心得