posted 17 years ago
Consider this example.
The output is
Notice that print() is a class method, and printName() is an instance method.
When you call the method print() with a Test11 reference to a Test10 object, it calls the static method print() in Test11.
When you call the method printName() with a Test11 reference to a Test10 object, it calls the overridden printName() method in Test10.