Get your System Name and IP Address using JAVA

The following is the Java code for getting IP address and system name. 
  1. import java.net.InetAddress;  
  2. class DemoIp {  
  3.     public static void main(String args[]) throws Exception {  
  4.         System.out.println("Your system name & your IP Address is:");  
  5.         System.out.println(InetAddress.getLocalHost());  
  6.     }  
  7. }  
Thank you, keep learning and sharing.