Candibiotic
News Update :

Statics

Friday, August 21, 2009

Use static methods to implement behaviors that are not affected by the state of any instances.
Use static variables to hold data that is class specific as opposed to instance specific—there will be only one copy of a static variable.
All static members belong to the class, not to any instance.
A static method can't access an instance variable directly.
Use the dot operator to access static members, but remember that using a reference variable with the dot operator is really a syntax trick, and the compiler will substitute the class name for the reference variable, for instance:
d.doStuff();
becomes:
Dog.doStuff();
static methods can't be overridden, but they can be redefined.
Share this Article on :

0 comments:

Post a Comment

 

© Copyright Vinayak Wins 2010 -2011 | Design by Herdiansyah Hamzah | Published by Borneo Templates | Powered by Blogger.com.