static InetAddress getByName(String host)
Determines the IP address of a host, given the host's name.String getHostAddress()
Returns the IP address string in textual presentation.
Determines the IP address of a host, given the host's name.String getHostAddress()
Returns the IP address string in textual presentation.
static InetAddress getByName(String host)這個是通過主機名得到地址
String getHostAddress()這個是得到地址的字符串表示應該用這個啦
String getHostName()
Gets the host name for this IP address
却返回不了 pc16但我在DOS下: ping pc16
却返回 192.168.1.16pc16和pc19都和我在同一个局域网的,我通过局域网都可以访问这两台电脑。真不知问题出在哪里???
给定主机名,确定该主机的所有 IP 地址。