Thursday, April 25, 2013

Static access

Use of static:
  • Use static methods to implement behaviors that are not affected by the state of any instances.
  • Use static variable to hold data that is class specific as opposed to instance specific.
  • All static members belong to the class, not to any instance
  • A static method cannot access an instance variable directly.
  • static methods cannot be overridden, but they can be redefined.

No comments:

Post a Comment