import java.net.InetAddress;
import java.net.UnknownHostException;
public class GetHostName {
public static void main(String[] args) throws UnknownHostException {
InetAddress addr = null;
addr = InetAddress.getLocalHost();
System.out.println("Local host name:"+addr);
}
}