您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Java构造函数返回一个值,但是返回什么呢?

2024/8/18 5:38:05发布37次查看
没有。 java 构造函数不能返回值。如果需要,只需创建一个调用所需构造函数并返回所需值的方法。请参阅下面的示例。
public class tester { public tester(){} public static tester getinstance(){ tester tester = new tester(); return tester; }}
以上就是java构造函数返回一个值,但是返回什么呢?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product