import java.net.*;
import java.io.*;
public class ip_host {
public static void main(String args[]) throws Exception {
System.out.println("Enter the host name :");
String n = new DataInputStream(System.in).readLine();
InetAddress ipadd = InetAddress.getByName(n);
System.out.println("IP address :" + ipadd);
}
}
我有这个程序可以找到 IP 地址,但我想扩展它以找到 IP 类。