谁能建议我如何从包含IPV4和IPV6地址的主机名中获取IPV6地址。我尝试使用java.net.InetAddress.getHostAddress来获取它,但这只是给我了ipv4。 最佳答案 您将必须使用java.net.Inet6Address.getHostAddress()