Final (Java): Difference between revisions

Content deleted Content added
m Reverted edits by 82.22.71.88 (talk) to last version by Abdull
SAE1962 (talk | contribs)
m Final methods: Link stated more precisely. Small corrections done.
Line 23:
</source>
 
A common misconception is that declaring a class or method final improves efficiency by allowing the compiler to directly insert the method inline where everwherever it is called. This is not completely true; the compiler is unable to do this because the classes loaded at runtime might not be the same versions of the ones that were just compiled. Further, the runtime environment and [[Just-in-time compilation|JIT]] compiler have the information about exactly what classes have been loaded, and are able to make better decisions about when to inline, whether or not the method is final.[http://www.ibm.com/developerworks/java/library/j-jtp1029.html].
 
= Final variables =