Final (Java): Difference between revisions

Content deleted Content added
m Final variables: wikification
Line 33:
</source>
 
A common misconception is that declaring a class or method final improves efficiency by allowing the compiler to directly insert the method inline wherever it is called. In fact the compiler is unable to do this because the method is loaded at runtime and might not be the same version as the one that was just compiled. Only the runtime environment and [[Just-in-time compilation|JIT]] compiler have the information about exactly which classes have been loaded, and are able to make better decisions about when to inline, whether the method is final or not.<ref>[http://www.ibm.com/developerworksideveloperworks/java/library/j-jtp1029.html Java theory and practice: Is that your final answer?]</ref>
 
== Final variables ==