Skip to content
New issue

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

重载和重写的区别 #237

Open
zhonghuasheng opened this issue Apr 1, 2020 · 0 comments
Open

重载和重写的区别 #237

zhonghuasheng opened this issue Apr 1, 2020 · 0 comments
Labels

Comments

@zhonghuasheng
Copy link
Owner

  • 重载:同名不同参(参数类型,个数,顺序至少有一个不同)
  • 重写:同名同参,子类方法不能缩小父类方法的访问权限;子类方法不能抛出比父类方法更多的异常;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant