public static void main(String[] args) throws Exception {标签:Java,基础,System,address,println,InetAddress,out From: https://www.cnblogs.com/gagaya2/p/17796346.html
//address是IP的对象,也是一台电脑的对象
InetAddress address = InetAddress.getByName("172.18.153.251");
System.out.println(address.getHostName());
System.out.println(address.getHostAddress());
}