InetAddress
这个类表示Internet协议的地址
public static void main(String[] args) throws Exception {
InetAddress ip1=InetAddress.getLocalHost();//静态方法
InetAddress ip2=InetAddress.getByName("www.baidu.com");
System.out.println(ip1.getHostAddress());
System.out.println(ip2.getHostName());
System.out.println(ip1.getHostName());
System.out.println(ip2.getHostAddress());
System.out.println(ip2.isReachable(5000));
}