想问问大伙JAVA中的多态。表现形式。
我看thinking in java3中的多态
People are often confused by other, non-object-oriented features of Java, like method overloading, which are sometimes presented as object-oriented. Don’t be fooled: If it isn’t late binding, it isn’t polymorphism
这个是thingking in java3 中的的Summary中的一段。
但是4中好像没有。
望大牛帮忙解析下。
------解决方案--------------------
Overload:一个类中多态表现
- Java code
class Tiger() { public void eat() { System.out.println("I'm eating, YamiYami!"); } public void eat(String food) { System.out.println("I'm eating " + food + ", YamiYami!"); }}