What is so important about polymophism?
问题 I have a decent understanding about polymorphism but my question is for example, in the code I posted below, what is so special about being able to make an object of Cat while using an animal type for the variable. What purpose does that serve? Also assume that the makenoise method is being override in each objects own class and that the class all the other classes are inheriting from is the animal class. public class Demo { public static void main(String[] args) { Animal a1 = new Cat(); /