Java 实现判断 主机是否能 ping 通 代码实现如下: import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; /** * Created by Miracle Luna on 2019/12/10 */ public class PingUtil { public static void main(String[] args) { String host1…