我试图寻找解决方案,但我发现我不知道如何申请这种情况.请帮我纠正我的代码.
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");
}
}
Run Code Online (Sandbox Code Playgroud)
好吧,首先要检查的是你是否A
在你的文件或同一个包中调用了另一个类.
归档时间: |
|
查看次数: |
41523 次 |
最近记录: |