Gur*_*epS 7 java oop overriding
This is a very naiveish question, but here goes:
An overriden method from a base class will mean that calls to the sub class will call the derived, overriden method, correct?
Thus, if there is no override annotation, the method in the base class will be called. So the override method will serve purely to document the intent - call one version of a method over the other.
Is this the case?
This leads me to the following question:
What is the difference between an abstract class which 5-6 classes may derive from but the methods inherited in the derived classes are not overriden, and one class (Static or not being irrelevant), used by those 5-6 classes?
Jim*_*son 10
@Override注释仅用于在编译时捕获错误.它不会影响运行时的覆盖行为.我们的想法是让编译器有机会通知您方法名称或签名是错误的.
| 归档时间: |
|
| 查看次数: |
1888 次 |
| 最近记录: |