劉任昌w3schools學Java,整數int,字串String,迴圈for loop,Character.toString將字碼轉字元

Java,整數int,字串String,迴圈for loop

/*劉任昌2022/10/21學習迴圈for loop利用挪威w3schools*/ public class Main { /*類別名稱Main存檔的檔名必須Main.java*/ public static void main(String[] args) { int i, j, k=12; /*宣告整數integer, i*/ String a="第", b="列: "; /*宣告整數字串 */ for (i = k; i > 0; i--) { System.out.print( a + i + b); /*+用於字串變數,串接,相當於excel的*/ for (j=1; j<=i; j++) System.out.print(j+" "); /*語法syntax錯誤,邏輯logic錯誤*/ System.out.println(); /*println=print line印完到下一列*/ } } }

w3schools學習Java截圖

Character.toString將字碼轉字元

/*劉任昌2022/10/21學習迴圈for loop利用挪威w3schools*/ public class Main { /*類別名稱Main存檔的檔名必須Main.java*/ public static void main(String[] args) { int i, j, k=12; /*宣告整數integer, i*/ String a="第", b="列: "; /*宣告整數字串 */ for (i = k; i > 0; i--) { System.out.print( a + i + b);/*+用於字串變數,串接,相當於excel的&*/ for (j=1; j<=i; j++) System.out.print(j+" "); /*語法syntax錯誤,邏輯logic錯誤*/ System.out.println(); /*println=print line印完到下一列*/ } /*捲括號curly bracket{ }*/ a = " 字碼是字元 "; System.out.println(48 + a + Character.toString(48)); System.out.println(65 + a + Character.toString(65)); System.out.println(97 + a + Character.toString(97)); System.out.println(122 + a + Character.toString(122)); System.out.println("傳統ascii只到127,字碼系統再擴展到所有文字unicode系統"); for ( i = 40845; i < 40860; i++){ b = Character.toString(i); System.out.println(i + a + b); } } }

Character.toString將字碼轉字元

字元轉字碼Integer.valueOf

留言

  1. https://xdrcfvghyujiok8945656.blogspot.com/2022/10/w3schoolsjavaintstringfor-loopcharactor.html

    回覆刪除
  2. https://rtytrdtfg.blogspot.com/2022/10/w3schoolsjavaintstringfor.html

    回覆刪除
  3. https://tgyhjikolujik2554.blogspot.com/2022/10/w3schoolsjavaintstringfor.html

    回覆刪除
  4. https://d11150114.blogspot.com/2022/10/w3schoolsjavaintstringfor.html

    回覆刪除
  5. https://d11150115.blogspot.com/2022/10/w3schoolsjavaintstringfor.html

    回覆刪除
  6. https://d11150108.blogspot.com/2022/10/wschoojavaintstring-for.html

    回覆刪除
  7. https://d11150116.blogspot.com/2022/10/w3schooljavaintstringfor.html

    回覆刪除
  8. https://d11150113.blogspot.com/2022/10/20221021for-loopw3schools.html

    回覆刪除
  9. https://643gjeytfru4312.blogspot.com/2022/10/w3schoolsjavaintstringfor.html

    回覆刪除
  10. https://cindy-javascript.blogspot.com/2022/10/w3schooljavaintstringfor.html

    回覆刪除
  11. https://jdoifjopq1264.blogspot.com/2022/10/w3schooljavaintstringfor.html

    回覆刪除
  12. https://iuytjhg5261.blogspot.com/2022/10/w3schoolsjavaintstringfor.html

    回覆刪除
  13. https://d11150112.blogspot.com/2022/10/w3schooljavaintstringfor.html

    回覆刪除
  14. https://lihtml-css-javascript-java.blogspot.com/2022/10/0-i-system.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

劉任昌對照Python與JavaScript指令

劉任昌Python集合set清單list元組tuple字典dictionary

劉任昌python, input, str, float