You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
370 B
16 lines
370 B
import java.net.Inet4Address;
|
|
import java.net.InetAddress;
|
|
import java.net.UnknownHostException;
|
|
|
|
/**
|
|
* @author: geng by
|
|
* @createDate: 2022/8/1
|
|
*/
|
|
public class Test {
|
|
|
|
@org.junit.Test
|
|
public void test() throws UnknownHostException {
|
|
InetAddress localHost = Inet4Address.getLocalHost();
|
|
System.out.println(localHost.getHostAddress());
|
|
}
|
|
}
|
|
|