Socket programming and networking examples in Java.
Certain methods are provided by this class to access the IP addresses & hostnames.
InetAddress objects are created by using these methods.
Static InetAddress getLocalHost() throws UnknownHostException For the local machine, InetAddress is returned by this method.
Static InetAddress getByName(String host) throws UnknownHostException For specified hostname, InetAddress object is returned by this method. Hostname could either be an IP like 184.108.40.206 or pneumonic