第九章多态 #572
第九章多态 #572
Conversation
| @@ -85,7 +85,7 @@ public class Music { | |||
| Wind.play() MIDDLE_C | |||
| ``` | |||
|
|
|||
| 在 `main()` 中你看到了 `tune()` 方法传入了一个 **Wind** 引用,而没有做类型转换。这样做是允许的—— **Instrument** 的接口一定存在于 **Wind** 中,因此 **Wind** 继承了 **Instrument**。从 **Wind** 向上转型为 **Instrument** 可能“缩小”接口,但不会比 **Instrument** 的全部接口更少。 | |||
| 在 `main()` 中你看到了 `tune()` 方法传入了一个 **Wind** 引用,而没有做类型转换。这样做是允许的—— **Instrument** 的接口一定存在于 **Wind** 中,因为 **Wind** 继承了 **Instrument**。从 **Wind** 向上转型为 **Instrument** 可能“缩小”接口,但不会比 **Instrument** 的全部接口更少。 | |||
sjsdfg
Sep 11, 2020
Collaborator
这句话整个语序都有问题吧,找原文上来一起改进下
这句话整个语序都有问题吧,找原文上来一起改进下
chong-xiaowu
Sep 14, 2020
Author
Contributor
没找到原文资源,qq群通过下,我看一下原文,申请qq:1126802952
没找到原文资源,qq群通过下,我看一下原文,申请qq:1126802952
…暂时还没看到,idea工具看到虚线无法跳转)

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

87行的“因此”改为“因为”感觉更符合语义