InetAddress : 此类表示Internet协议(IP地址)

方法1:.public static InetAddress.getByName(String host):确定主机名称的ip地址。(主机名称可以是机器名,或者是IP地址)

方法2:public String getHostName():获取此Ip地址的主机名

方法3:public String getHostAddress():返回文本显示中的IP地址字符串

如下测试:
InetAddress (2020.8.16)

控制台输出结果:

InetAddress (2020.8.16)

相关文章:

  • 2021-04-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-08-19
  • 2022-12-23
  • 2022-01-15
猜你喜欢
  • 2021-06-07
  • 2022-03-09
  • 2021-06-09
  • 2022-03-06
  • 2022-12-23
  • 2021-08-29
相关资源
相似解决方案