Remember styles of inheritance
Remember the various styles of inheritance :
- interface + no implementation - an interface method, or an abstract method
- interface + overridable implementation - a non-final method
- interface + non-overridable implementation - a final method
- disallow it completely - declare the class as final
- allow it, but disallow all overrides - declare all methods as final
-
allow it, and permit some overrides - declare some methods as non-
final -
require it - declare some methods as
abstract
See Also :
Would you use this technique?
|
|