<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Java 引用變量 > 原文: [https://javabeginnerstutorial.com/core-java-tutorial/java-reference-variable/](https://javabeginnerstutorial.com/core-java-tutorial/java-reference-variable/) 引用變量用于引用對象。 它們以無法更改的特定類型聲明。 ## 引用變量的類型 * 靜態變量 * 實例變量 * 方法參數 * 局部變量 ## 靜態變量示例 ```java class test { //below variable is static variable means it is class level variable static int i; public static void main(String[] args) { // As i is an static variable it can be accessed directly without using any object System.out.println("Value before calling method1: " + i); test t1 = new test(); t1.method1(); System.out.println("Value after calling method1: " + i); t1.method2(); System.out.println("Value after calling method2: " + i); } void method1() { i++; } void method2() { i++; } } ``` ## 實例/局部/方法參數示例 ```java class MPE { // Instance Variable int i; public static void main(String[] args) { /* * Here i is an Instance variable. */ test t1 = new test(); System.out.println("Value before calling method1: " + t1.i); } /* * Here j is a method parameter. And k is a local variable. * * Note**: Local variables life is only till the end of method */ void method1(int j) { int k; i = j; /* * Local Variable(k)'s life ends once execution for this method * completes. As k is local is variable it needs to be initialized * before we can use it. But as it is not getting used here, it can stay here without initializing */ } } ```
                  <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>

                              哎呀哎呀视频在线观看