SyntaxFix
Write A Post
Hire A Developer
Questions
Best approach:
public static boolean isOnline() { try { InetAddress.getByName("google.com").isReachable(3); return true; } catch (UnknownHostException e){ return false; } catch (IOException e){ return false; } }