A common misconception is that declaring a class or method as <code>final</code> improves efficiency by allowing the compiler to directly insert the method inline wherever it is called.In(see fact,[[inline theexpansion]]). compiler is unable to do thisBut because the method is loaded at runtime[[run andtime might(program notlifecycle bephase)|runtime]], thecompilers sameare versionunable asto thedo one that was just compiledthis. Only the runtime environment and [[Just-in-time compilation|JIT]] compiler have the information aboutknow exactly which classes have been loaded, and so only they are able to make decisions about when to inline, whether or not the method is final.<ref>[http://www.ibm.com/developerworks/java/library/j-jtp1029.html Java theory and practice: Is that your final answer?]</ref>
An exception to this are machineMachine code compilers (those whowhich buildgenerate directly executable, platform-specific [[machine code).]], Inare thisan case,exception. whenWhen using [[static linking]], the compiler can safely assume that the methods, and alsovariables compiletime-computable variables,at can[[compile-time]] may be inlined.