package java.net;
public class InetAddressDemo {
public static void main(String[] args) throws UnknownHostException {
InetAddress ip=InetAddress.getLocalHost();
System.out.println(ip.getHostName());
System.out.println(ip.getHostAddress());
}
}
在eclipse运行此段代码,报错,如图片所示,是何问题?
|
|