【发布时间】:2014-08-10 02:24:48
【问题描述】:
当您的班级只有Object 作为父母时,是否有必要或良好的做法是致电super()?
即
public class Foo {
public Foo() {
super();
// Other stuff
}
}
或
public class Foo {
public Foo() {
// Other stuff
}
}
【问题讨论】:
当您的班级只有Object 作为父母时,是否有必要或良好的做法是致电super()?
即
public class Foo {
public Foo() {
super();
// Other stuff
}
}
或
public class Foo {
public Foo() {
// Other stuff
}
}
【问题讨论】:
没有。它是隐式调用的,所以没有理由调用它。
【讨论】:
super(); 通话特别相关。