英语翻译Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor.Must define an explicit constructorImplicit super constructor A() is not visible for default constructor.Must define an explicit c

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 08:14:07
英语翻译Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor.Must define an explicit constructorImplicit super constructor A() is not visible for default constructor.Must define an explicit c
xTAOA+slMSXIhă^<ev;-bP PH@J"$d&$^{{{2)c_j#294Yk\79,#ш09LCzeߤFM}cFj#+o374oq%Ô4FF0OnF8 &+Pf`ag\vTZ? 1 ™>c ߄,yDQ"*> bm-soax$ă0 &Gp'F>dHaBh2B**l@m䷋3 sr²EnqSiabϹIȋ#V<4< ӽWYt/+|]f^e;:r)SUjjU崝%9Mled*WoO]1ߔ5+O7/b[{3+[nASH.\bM~wgpxB޷ qRq`^Y-ݢ1V̔GUn/(x4C6[pGxoI r&=P~k%MzH$uAhl.su.PruEV"-+hedEo/w1YTտDWIQ2g /On

英语翻译Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor.Must define an explicit constructorImplicit super constructor A() is not visible for default constructor.Must define an explicit c
英语翻译
Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor.Must define an explicit constructor
Implicit super constructor A() is not visible for default constructor.Must define an explicit constructor

英语翻译Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor.Must define an explicit constructorImplicit super constructor A() is not visible for default constructor.Must define an explicit c
我用eclipse模拟出了你这两个错误:
package exception;
import java.io.*;
public class A {
public A()throws FileNotFoundException{
throw new FileNotFoundException();
}
}
public class B extends A{
public static void main(String[] args)
{
B b=new B();
}
}
以上会显示你的第一条错误提示信息,意恩就是:默认的子类构造函数无法解决由父类隐式构造函数抛出的FileNotFoundException(即无法找到文件异常),必须定义一个显示的构造函数(就像B没有定义构造函数,只能使用默认的构造函数).
package exception;
import java.io.*;
public class A {
private A(){
}
}
public class B extends A{
public static void main(String[] args)
{
B b=new B();
}
}
以上会出现你的第2条错误信息,看见没A的构造函数是private的.意思就是:隐式的父类构造函数A()对子类的默认构造函数是不可见的(not visible),必须定义一个显式的构造函数.
个别词:implicit 暗示的,隐示的 explicit 明确的,显示的.