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 18.104.22.168 or pneumonic