try{
InetAddress host=InetAddress.getByName(ip);
out.println("192.168.0.88的主机名是:"+host);
}catch(Exception e){
out.println(e);
}
为什么我得不到网络标志“A”
InetAddress host=InetAddress.getByName(ip);
out.println("192.168.0.88的主机名是:"+host);
}catch(Exception e){
out.println(e);
}
为什么我得不到网络标志“A”
import java.net.*;public class test17
{
public static void main(String args[])
{
String ip="www.sina.com.cn";
try
{
InetAddress host=InetAddress.getByName(ip);
System.out.println(ip+ "的主机名是:"+host.getHostAddress());
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}