英语翻译Default constructor cannot handle exception type FileNot
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/05/06 05:28:08
英语翻译
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 constructor
Implicit super constructor A() is not visible for default constructor.Must define an explicit constructor
我用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 明确的,显示的.
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 明确的,显示的.
英语翻译Default constructor cannot handle exception type FileNot
英语翻译(1.)Class constructor,or type initializer,is the method
英语翻译EXCEPTION:DEFAULT SYSTEM ROUTE RECORD NOT FOUND :PLEASE
错误no appropriate default constructor available
'A::A' :no appropriate default constructor available
英语翻译Exception:(backup printer)MEMO:Cannot write to the commu
英语翻译Storm angle valve with handle,Type:SV-FCD-A-RMH- 150- se
my computer cannot type chinese
英语翻译electricity is a type of energy which cannot be seen but
英语翻译The Type of the file system is convert cannot run becaus
英语翻译The AC power adapter wattage and type cannot be determin
英语翻译AC adapter type cannot be determind,it will prevent opti