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.
17 lines
370 B
17 lines
370 B
3 years ago
|
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());
|
||
|
}
|
||
|
}
|