gpt4 book ai didi

java - 如何将参数传递给构造函数?

转载 作者:行者123 更新时间:2023-12-02 09:02:38 25 4
gpt4 key购买 nike

我有带有构造函数的自动生成的类

Userinput(Input<Integer>id, Input<String>name) {
this.id = id;
this.name = name;
})

如何将值传递给构造函数。

最佳答案

Userinput userInput = new Userinput(1, "test");

关于java - 如何将参数传递给构造函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60058678/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com