class Base{
public void f () {
System.out.println("f Throws Exception");
}
}
class Derived extends Base{
public void f() throws Exception{
System.out.println("f throws no Exception");
}
}
这个编译会出错
class Base{
public void f () throws Exception {
System.out.println("f Throws Exception");
}
}
class Derived extends Base{
public void f() {
System.out.println("f throws no Exception");
}
}
这个没有错