Java Local Host Get getLocalHostName()

Here you can find the source of getLocalHostName()

Description

get Local Host Name

License

Apache License

Declaration

public static String getLocalHostName() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.InetAddress;

public class Main {
    public static String getLocalHostName() {
        try {// ww w.j a va  2 s . c o m
            InetAddress addr = InetAddress.getLocalHost();
            return addr.getHostName();
        } catch (Exception e) {
            return "";
        }
    }
}

Related

  1. getLocalHostName()
  2. getLocalhostName()
  3. getLocalHostName()
  4. getLocalHostName()
  5. getLocalHostname()
  6. getLocalHostName()
  7. getLocalHostname()
  8. getLocalHostName()
  9. getLocalHostName()