public class O1 { public class Top { public void f(Object o) { System.out.println("Top.f(Object) = " + o); } } public class Bottom extends Top { public void f(Object o) { System.out.println("Bottom.f(Object) = " + o); } public void f(String s) { System.out.println("Bottom.f(String) = " + s); } } public void top() { Top top = new Bottom(); top.f(new java.util.Vector()); top.f("hello"); top.f((Object)"hello"); } public void bottom() { Bottom top = new Bottom(); top.f(new java.util.Vector()); top.f("hello"); top.f((Object)"hello"); } public static void main(String[] args) { O1 olt = new O1(); if (args.length != 0) olt.top(); else olt.bottom(); } }