| An example of using a class variable and class method would be to keep track of how many instances of a class are created. Say you had a class "petDog" and you had a class variable "numberOfPetDogs." Each time the class method "new" is called you can increment this value. Then each dog created has access to this shared variable, and knows how many other competitors it has when racing to the food bowl in your kitchen...or something |