Java program to get IP Address
In this example we are gonna see how to get IP address of a System. The steps are as follows:
1) Get the local host address by calling getLocalHost() method of InetAddress class.
2) Get the IP address by calling getHostAddress() method.
public static InetAddress getLocalHost() throws UnknownHostException: Returns the address of the local host. This is achieved by retrieving the name of the host from the system, then resolving that name into an InetAddress. Note: The resolved address may be cached for a short period of time.
#Java #JavaTutorial #Coding
Видео Java program to get IP Address автора Программируй с острым умом
Видео Java program to get IP Address автора Программируй с острым умом
Информация
5 декабря 2023 г. 14:06:41
00:04:53
Похожие видео