Java Local Host Get getLocalHostname()

Here you can find the source of getLocalHostname()

Description

get Local Hostname

License

Open Source License

Declaration

public static String getLocalHostname() 

Method Source Code


//package com.java2s;

import java.net.*;

public class Main {
    private static String localHostName_ = null;

    public static String getLocalHostname() {
        if (localHostName_ == null)
            try {
                localHostName_ = InetAddress.getLocalHost().getHostName();
            } catch (UnknownHostException e) {
            }/*from  w  w  w  . j av a2s .  co m*/
        return localHostName_;
    }
}

Related

  1. getLocalHostName()
  2. getLocalhostName()
  3. getLocalHostName()
  4. getLocalHostName()
  5. getLocalHostName()
  6. getLocalHostName(boolean includeDomain)
  7. getLocalHostName(boolean useHostname)
  8. getLocalHostNames()
  9. getLocalHosts()