Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
重写时,如果子类方法抛出的异常是运行时异常,父类方法可以不抛异常。
public class SuperClass{ public void test(){
}
class ChildClass extends SuperClass{
@Override public void test() throws NullPointerException{ }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
重写时,如果子类方法抛出的异常是运行时异常,父类方法可以不抛异常。
public class SuperClass{
public void test(){
}
class ChildClass extends SuperClass{
}
The text was updated successfully, but these errors were encountered: