(original) (raw)

import java.net.*; class PingZero { public static void main(String args[]) { try { InetAddress inetAddress = InetAddress.getByAddress(new byte[] { 0, 0, 0, 0 }); boolean b = inetAddress.isReachable((int) (1.0 * 3000)); if (b) { System.out.println(" 0.0.0.0 is reachable ! "); } else { System.out.println(" 0.0.0.0 is not reachable ! "); } } catch (Exception e) { e.printStackTrace(); } } }