定义 指方法上的多态,不是属性上的多态 tips:多态环境 hsy可选择和dog,cat玩 此时只需更换animal种类,此时playwithcat,playwithdog等等无需再改 总结: 等价: 内存分析: