相关疑难解决方法(0)

Java默认构造函数

究竟什么是默认构造函数 - 你能告诉我以下哪一个是默认构造函数,以及它与其他构造函数的区别是什么?

public Module() {
   this.name = "";
   this.credits = 0;
   this.hours = 0;
}

public Module(String name, int credits, int hours) {
   this.name = name;
   this.credits = credits;
   this.hours = hours;
}
Run Code Online (Sandbox Code Playgroud)

java constructor default-constructor

147
推荐指数
7
解决办法
37万
查看次数

标签 统计

constructor ×1

default-constructor ×1

java ×1