package test;

import java.io.IOException;
import java.net.*;
public class HostInfo {
	public static void main(String args[])throws Exception {
	HostInfo host = new HostInfo();
	host.init();
	}
	public void init() throws Exception{
//		try {
			InetAddress myHost = InetAddress.getLocalHost();
			System.out.println(myHost.getHostAddress());
			System.out.println(InetAddress.getByName(myHost.getHostName()));
//		}catch (NumberFormatException ex) {
//			System.err.println("Cannot find local host");
//		}catch (UnknownHostException uhe){
//			
//		}catch (Exception e){
//			
//		}
	}
}
