Check out the following basic code (assume that dog has a method called bark):
Dog d = new Dog(); Object o = d; o.bark(); // error
But why? Isn't o just a pointer to a memory address which has the dog object? If so, why can't the compiler see that the object has a method called bark? Or, to ask the question another way, why is Java designed to check the object reference to see if the method exists instead of the object itself?