Friday, January 11, 2013

Java program to ping an IP address

Below is the Java program to ping an IP address.


Also note that you can use below syntax to check if remote IP address is is reachable or not.

String ip = "google.com";
InetAddress address = InetAddress.getByName(ip);
boolean chkConnection = address.isReachable(1000);