Java Method Overloading by changing the data type of parameters

Java Method Overloading by changing the data type of parameters
/**
 * @author lautturi.com 
 * Java example: Java Method Overloading by different parameter types
 */

import java.util.*;

public class Lautturi {

	// this method accepts int
    private static void display(int i){
        System.out.println("int:"+i);
    }
    
    // this method accepts String object
    private static void display(String str){
        System.out.println("String:"+str);
    }
    
	public static void main(String[] args) {

	        display(123);
	        display("Hello Java");

	}

}
Sourc‮e‬:www.lautturi.com

output:

int:123
String:Hello Java
Created Time:2017-10-04 23:05:03  Author:lautturi