在自学struts2,其中有段代码总是不太明白,请高手帮我解释一下!谢谢!
教材中的环境:
Customer是mysql数据库中一一个表,含以下4个字段:不明白的是红色代码:我明明没有继承任何类,为什么在构造函数中会用super()?是什么用义?如果说是默认继承自java.lang.object,可object中的构造也就是Object(),在这里能有什么意义啊??
public class Customer {
private String custname;
private String pwd;
private Integer age;
private String address;
public Customer() {
super();
}
public Customer(String custname, String pwd) {
super();
this.custname = custname;
this.pwd = pwd;
}
public Customer(String custname, String pwd, Integer age, String address) {
super();
this.custname = custname;
this.pwd = pwd;
this.age = age;
this.address = address;
请教高手!!!
strutssuper javaee
教材中的环境:
Customer是mysql数据库中一一个表,含以下4个字段:不明白的是红色代码:我明明没有继承任何类,为什么在构造函数中会用super()?是什么用义?如果说是默认继承自java.lang.object,可object中的构造也就是Object(),在这里能有什么意义啊??
public class Customer {
private String custname;
private String pwd;
private Integer age;
private String address;
public Customer() {
super();
}
public Customer(String custname, String pwd) {
super();
this.custname = custname;
this.pwd = pwd;
}
public Customer(String custname, String pwd, Integer age, String address) {
super();
this.custname = custname;
this.pwd = pwd;
this.age = age;
this.address = address;
请教高手!!!
strutssuper javaee
方法的。
所以那些个super()可以写也可以不写