
Ping with J2SE 1.5.0
The following code shows you how to simulate the “ping” command with the J2SE Tiger InetAddress.isReachable method. import java.io.*;import java.net.*;public class reachable{ public static void main(String args[]) { String[] addrs= {“www.java.sun.com”,”www.yahoo.com”,”www.google.com”}; try{ for(int i=0;i