View Single Post
  #25 (permalink)  
Old 03-28-2008, 05:15 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
amansundar is on a distinguished road
Default Re: Android Tips and tricks

Prefer Static Over Virtual

If you don't need to access an object's fields, make your method static. It can be called faster, because it doesn't require a virtual method table indirection. It's also good practice, because you can tell from the method signature that calling the method can't alter the object's state.
__________________
cheers
Aman
Reply With Quote