December 1999
Intermediate to advanced
816 pages
20h 27m
English
The class java.net.InetAddress provides support for getting host names with IP addresses or getting IP addresses using host names. Listing 14.1 shows a program that uses several of these methods.
The INetAddress class exists to allow a program to find out IP addresses based on host names and host names based on IP addresses. The INetAddress class also provides a mechanism to identify the current host on which the program is running, which can be quite helpful in many situations that call for an IP address or INetAddress object.
import java.io.*; import java.net.*; ... |
Read now
Unlock full access