public class MainClass { void myMethod(int i) { System.out.println("int version"); } void myMethod(String s) { System.out.println("String version"); } public static void main(String args[]) { MainClass my = new MainClass(); char ch = 'p'; my.myMethod(ch); } }