public class O2 { public class Top { public void f(Object o, String s) { System.out.println("Top.f(Object,String) = " + o + "," + s); } public void f(String s, Object o) { System.out.println("Top.f(String,Object) = " + s + "," + o); } public void f(String s, String s1) {} } public class Bottom extends Top { public void f(String s, String s1) { System.out.println("Bottom.f(String,String) = " + s + "," + s1); } } public void top() { Top x = new Bottom(); x.f("bye","bye"); } public void bottom() { Bottom x = new Bottom(); x.f("bye","bye"); } public static void main(String[] args) { O2 olt = new O2(); if (args.length != 0) olt.top(); else olt.bottom(); } }