Re: Why java is not 100% pure object oriented language? For Final Keyword,
The final modifier can be applied to four Java constructs:
1. variables: a final variable can be set once and only once.
2. fields: a final field can also be set only once, by the constructor of the class which defines it.
3. methods: a final method cannot be overridden nor hidden.
4. classes: a final class cannot be extended.
Notice how using final is an entirely negative act. The final keyword works by subtracting, limiting default language mechanisms: the ability to override a method, to set a variable or a field. The motivations behind using final fall into three broad categories: correctness, robustness, and finally performance.
--kamal. |