![]() |
1
4
继承会自动使父级的所有方法(“函数”)对子级可用。但是,如果子级重新实现了一个方法,这将隐藏子级的父级方法。
一般来说,一种方法应该使用
这是因为在深度继承中,一个方法不能只依赖于另一个方法是否/如何被重写 methods of well-behaved child classes are indistinguishable from methods of the parent class 一个方法只能可靠地知道它自己会重写 自己的父母 方法。 |
|
user3903342 · Java访问修饰符和调用的方法 7 年前 |
![]() |
Ratnesh Lal · 此处意外出现super关键字 8 年前 |
![]() |
Mark · Python2__bases__和超级 11 年前 |
![]() |
kharesp · 了解使用Super访问Superclass成员 11 年前 |