/* Multi-method example */ package mm; public class c{ public int m(Object o){ return 1;} public int m(String s){ return 2;} public static void main(String args[]){ c o = new c(); String a1 = new String("Hi"); Object a2 = new Object(); Object a3 = new String("Hello"); System.out.println(o.m(a1)); System.out.println(o.m(a2)); System.out.println(o.m(a3)); //returns 1 since method resolution is done statically } }