Skip to content

修改语句拗口问题 #624

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

Merged
merged 17 commits into from
Nov 27, 2020
Merged
Prev Previous commit
Next Next commit
修改语句拗口问题
  • Loading branch information
jim.deng committed Nov 25, 2020
commit 84e298c79dbb73e850b43ec49a86a7cc06c521b3
2 changes: 1 addition & 1 deletion docs/book/08-Reuse.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ doh(Milhouse)

````

**Homer** 的所有重载方法在 **Bart** 中都是可用的,尽管 **Bart** 引入了一种新的重载方法。在下一章中你将看到,使用与基类中完全相同的签名和返回类型覆盖相同名称的方法要常见得多。否则就会令人困惑。
**Homer** 的所有重载方法在 **Bart** 中都是可用的,尽管 **Bart** 引入了一种新的重载方法。在下一章中你将看到,使用重写(与基类中完全相同的方法签名和返回类型覆盖相同名称的方法)比起重载会更为常见,否则就会令人困惑。

你已经看到了Java 5 **@Override**注释,它不是关键字,但是可以像使用关键字一样使用它。当你打算重写一个方法时,你可以选择添加这个注释,如果你不小心用了重载而不是重写,编译器会产生一个错误消息:

Expand Down