fork(5) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.net.InetAddress;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Java4Ping
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // ping google.com
  14. InetAddress _inet = InetAddress.getByName("173.194.39.224");
  15. boolean _active = _inet.isReachable(10000);
  16. System.out.println("Google hayattami? "+ _active);
  17. }
  18. }
Success #stdin #stdout 0.07s 380288KB
stdin
Standard input is empty
stdout
Google hayattami? false