📜  如何找到 IP 地址 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:35.343000             🧑  作者: Mango

代码示例2
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());    
    }
}