【发布时间】:2012-03-24 02:08:00
【问题描述】:
在编译这个程序时,我得到了错误-
class Person {
Person(int a) { }
}
class Employee extends Person {
Employee(int b) { }
}
public class A1{
public static void main(String[] args){ }
}
错误 - 找不到构造函数 Person()。 为什么需要定义 Person()?
【问题讨论】:
-
使用诸如 Eclipse 之类的 IDE 会立即为您提供更正的提示和快捷方式。
标签: java constructor superclass