How to Get Host Specific IP Address using JAVA

Here is the Java code. 
  1. import java.net.InetAddress;  
  2. import java.net.UnknownHostException;  
  3. public class HostIp {  
  4.     public static void main(String[] args) {  
  5.         InetAddress address = null;  
  6.         try {  
  7.             address = InetAddress.getByName("www.c-sharpcorner.com");  
  8.         } catch (UnknownHostException e) {  
  9.             System.exit(2);  
  10.         }  
  11.         System.out.println(address.getHostName() + " = " + address.getHostAddress());  
  12.         System.exit(0);  
  13.     }  
  14. }  
Thank you, keep learning and sharing.