类型 A 已定义错误
我试图寻找解决方案,但我发现的我不知道在这种情况下如何应用。请帮我更正我的代码。
package Exercise;
public class Ex11_11 {
public static void main(String[] args) {
A a = new A(3);
}
}
class A extends B { // type A is already defined, A has a red underline
public A (int t) {
System.out.println("A's constructor is invoked");
}
}
class B { // type B is already defined, B has a red underline
public B () {
System.out.println("B's constructor is invoked");
}
}