<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Java 程序:使用循環從 A 到 Z 顯示字符 > 原文: [https://www.programiz.com/java-programming/examples/display-alphabets](https://www.programiz.com/java-programming/examples/display-alphabets) #### 在此程序中,您將學習如何在 Java 中使用`for`循環打印英文字母。 您還將學習學會僅打印大寫和小寫字母。 ## 示例 1:使用`for`循環顯示大寫的 A 到 Z ```java public class Characters { public static void main(String[] args) { char c; for(c = 'A'; c <= 'Z'; ++c) System.out.print(c + " "); } } ``` 運行該程序時,輸出為: ```java A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ``` 您可以使用`for`循環在 A 到 Z 之間循環,因為它們在 Java 中存儲為 ASCII 字符。 因此,在內部,您可以在 65 到 90 之間循環打印英文字母。 稍加修改即可顯示小寫字母,如下例所示。 * * * ## 示例 2:使用`for`循環顯示小寫的 a 到 z ```java public class Characters { public static void main(String[] args) { char c; for(c = 'a'; c <= 'z'; ++c) System.out.print(c + " "); } } ``` 運行該程序時,輸出為: ```java a b c d e f g h i j k l m n o p q r s t u v w x y z ``` 您只需將`"A"`替換為`"a"`,將`"Z"`替換為`"z"`以顯示小寫字母。 在這種情況下,您會在內部循環通過 97 到 122。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看