View RSS Feed

My Java Tips

Final keyword improves performance

Rate this Entry
by , 05-21-2011 at 10:10 PM (2142 Views)
Its right to say that final keyword improves performance. For example, if you declare a method as final, then you cannot override it in derived classes. When this is told to compiler in advance using final keyword, it improves performance.

Java Code:
public final void doSomethng()
{
...
}
Knowing that a method cannot be overridden, complier inline that method into its derived classes.
Final variables, especially static final variables, are well worth using as standard.

Hope this helps.

Submit "Final keyword improves performance" to Facebook Submit "Final keyword improves performance" to Digg Submit "Final keyword improves performance" to del.icio.us Submit "Final keyword improves performance" to StumbleUpon Submit "Final keyword improves performance" to Google

Tags: final Add / Edit Tags
Categories
Performance

Comments