📅  最后修改于: 2022-03-11 15:00:32.594000             🧑  作者: Mango
import java.net.InetAddress;
import java.net.UnknownHostException;
public class FindIPaddress {
public static void main(String[] args) throws UnknownHostException {
InetAddress a = InetAddress.getLocalHost();
System.out.println(a.getHostAddress());
}
}