A reference variables type determines the methods that can be invoked on the object the variable is referencing
What method is called is decided at runtime based on the object type.
In your case the the method makeNoise() is allowed because the class of the reference variable Mammal has a method called makeNoise(). The actual method to be called is the method on the Zebra (because it overrides the one in Mammal)
posted 8 years ago
Totally forgot about the overriding part; now I understand