<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 package com.dodoke.demo1; public class Person { private String name; private Integer age; private Integer sex;//0表示女,1表示男 private String birthday; private Double height; private Double weight; private Boolean isMarry;//true 結婚 false 未婚 public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Integer getSex() { return sex; } public void setSex(Integer sex) { this.sex = sex; } public String getBirthday() { return birthday; } public void setBirthday(String birthday) { this.birthday = birthday; } public Double getHeight() { return height; } public void setHeight(Double height) { this.height = height; } public Double getWeight() { return weight; } public void setWeight(Double weight) { this.weight = weight; } public Boolean getIsMarry() { return isMarry; } public void setIsMarry(Boolean isMarry) { this.isMarry = isMarry; } public Person() { super(); } public Person(String name, Integer age, Integer sex, String birthday, Double height, Double weight, Boolean isMarry) { super(); this.name = name; this.age = age; this.sex = sex; this.birthday = birthday; this.height = height; this.weight = weight; this.isMarry = isMarry; } } ~~~ ~~~java package com.dodoke.demo1; public class Test { public static void main(String[] args) { //實例化person對象 Person person = new Person(); //在java中,使用基本數據類型作為成員變量的時候,都會存在默認值。在很多時候這些值都是有特定的意義的,所以不能隨便設置值 //因為存在自動裝箱和自動拆箱,直接設置和獲取沒有任何問題 person.setName("陸文鑫"); person.setAge(27); person.setBirthday("yyyy-MM-dd"); person.setSex(1); person.setHeight(180.0); person.setWeight(80.0); person.setIsMarry(true); System.out.println(person.getName()); System.out.println(person.getAge()); System.out.println(person.getSex()); System.out.println(person.getBirthday()); System.out.println(person.getHeight()); System.out.println(person.getWeight()); System.out.println(person.getIsMarry()); /** * 從基本數據類型轉變為引用數據類型 */ //從構造器創建 int a = 10; Integer a1 = new Integer(10);//使用基本數據類型參數 Integer a2 = new Integer("10");//使用字符串參數 //自動裝箱 -基本數據類型的變量可以直接轉化為對應包裝類類型的變量 Integer a3 = a; System.out.println("a:" + a +",a1:" + a1 + ",a2:" + a2 + ",a3:" + a3); /** * 從引用數據類型轉變為基本數據類型 */ //對象.xxxValue(); Boolean b = true; boolean b1 = b.booleanValue(); int b2 = a1.intValue(); //自動拆箱-引用數據類型(包裝類)可以直接轉化為對應基本數據類型變量 boolean b3 = b; int b4 = a2; System.out.println("b:" + b +",b1:" + b1 + ",b2:" + b2 + ",b3:" + b3 + ",b4:" + b4); } } ~~~
                  <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>

                              哎呀哎呀视频在线观看