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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 2.3.2 構造函數引用 ```java static class Model { int height; Model() { } Model(int height) { this.height = height; } } ``` 對于沒有參數的構造函數,可以使用: ```java Supplier<Model> m1 = Model::new; ``` 其等價于: ```java Supplier<Model> m1 = () -> new Model(); ``` ---- 對于簽名是`Model(int height)`的構造函數,那么可以使用: ```java Function<Integer, Model> m2 = Model::new; ``` 其等價于: ```java Function<Integer, Model> m2 = i -> new Model(i); ``` ---- 為了避免Function對Model類中height屬性造成的裝箱拆箱操作,可以使用IntFunction: ```java IntFunction<Model> m3 = Model::new; ``` 其等價于: ```java IntFunction<Model> m3 = i -> new Model(i); ``` ---- 以下是本例的源碼: ```java import java.util.function.Function; import java.util.function.IntFunction; import java.util.function.Supplier; public class MethodReferenceTest { public static void main(String[] args) { Supplier<Model> m1 = Model::new; m1 = () -> new Model(); Function<Integer, Model> m2 = Model::new; m2 = i -> new Model(i); IntFunction<Model> m3 = Model::new; m3 = i -> new Model(i); } static class Model { int height; Model() { } Model(int height) { this.height = height; } } } ```
                  <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>

                              哎呀哎呀视频在线观看