Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Performance Tuning Guide

- Previous: Assign null to Variables That Are No Longer Needed
- Next: Declare Constants as static final

### Declare Methods as final Only If Necessary

Modern optimizing dynamic compilers can perform inlining and other inter-procedural optimizations, even if Java methods are not declared `final`. Use the keyword `final` as it was originally intended: for program architecture reasons and maintainability.

Only if you are absolutely certain that a method must not be overridden, use the `final` keyword.

- Previous: Assign null to Variables That Are No Longer Needed
- Next: Declare Constants as static final

- © 2010, Oracle Corporation and/or its affiliates