Hi all,
This is about final/private in methods only.
final does not allow overriding of methods. If you do, you'll get a compiler error.
private methods are not visible outside their classes. So when you extend a class, you can give a method the same declaration as in the upper class. It is a redefinition (no override!) with no relation to the upper class method.
Especially no
polymorphism.
Example
The bar method is only necessary to call
foo from outside its class.
Outputs 3* ALPHA
Remove the private (-> default public or protected) and you'll have polymophic output.
make it final (in class Alpha), you'll get a compiler error in class Beta.
Yours,
Bu.
ps:
upper class methods can also be wearing large hats at a horse race or polo match.