// simple overloading example // // This class has three methods, all called "process" public class Over1 { public static void main(String[] args) { int x; float y = 12.34f; x = process(3.45, 12); // invokes method 3 x = process('f'); // invokes method 2 x = process(y); // invokes method 1 (automatic type conversion) } public static int process(double num) { System.out.println("Running method with 'double' parameter"); return 1; } public static int process(char letter) { System.out.println("Running method with 'char' parameter"); return 2; } public static int process(double num, int position) { System.out.println("Running method with two parameters"); return 3; } }