继承中的Default constructor cannot handle exception type问题,求大神指点
package it.cast.day21_2930;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
public class MyBufferReaderDemo2 extends BufferedReader {
public MyBufferReaderDemo2(Reader in) {
super(in);
// TODO Auto-generated constructor stub
}
public String readLine() throws IOException {
return super.readLine();
}
}
package it.cast.day21_2930;
import java.io.FileReader;
public class MyBufferReaderDemoTest2 {
MyBufferReaderDemo2 mbf2 = new MyBufferReaderDemo2(new FileReader("a.txt"));
[color=#FF0000]//在这里会提示:Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor. Must define an explicit constructor 请问怎么解决[/color]
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
public class MyBufferReaderDemo2 extends BufferedReader {
public MyBufferReaderDemo2(Reader in) {
super(in);
// TODO Auto-generated constructor stub
}
public String readLine() throws IOException {
return super.readLine();
}
}
package it.cast.day21_2930;
import java.io.FileReader;
public class MyBufferReaderDemoTest2 {
MyBufferReaderDemo2 mbf2 = new MyBufferReaderDemo2(new FileReader("a.txt"));
[color=#FF0000]//在这里会提示:Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor. Must define an explicit constructor 请问怎么解决[/color]
}
...全文
相关推荐
常见编程术语英汉对照
希望对阅读编程方面的英文原版图书的网友有所帮助
Google C++ Style Guide_英文版.pdf
Google C++ Style Guide_英文版.pdf
Java程序员常犯的五个错误
总结以前经验针对java编程的一些习惯,给出一些关于java编程的建议: 当你开始成为一个程序员的时候,在编程的时候很容易陷入下面所述的一些坏习惯,下面把Java程序员常犯的五个错误整理如下,需要的朋友可以参考下
Java英语总结
Java英语总结,有点用处的primit ive [' primit iv] 原始 evaluation [ivælju ' eiʃən] 赋值 scope [sk əup] 范围 instantiat ion [in stænʃi' eiʃən] 实例化 property [' prɔpəti] properties 属性
Effective C#
Effective C#, the book you should always keep and read.


Java SE
