Access rules  for accessing static variable are

  1. It is initialized to zero when the first object of its class is created. No other initialization is permitted.
  2. Only the copy of that member is created for the entire class and is shared by all the objects of that class, no matter how many objects are created.
  3. It is visible only within the class, but its lifetime is the entire program.

Access rules  for accessing static member functions are

    • A static function can have access to only  other static members(functions or variables) declared in the same class.
    • A static member function can be called using the class name(instead of its objects).