Java InetAddress Create getInetAddress()

Here you can find the source of getInetAddress()

Description

get Inet Address

License

Apache License

Declaration

private static InetAddress getInetAddress() 

Method Source Code

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

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Main {
    private static String hostName;

    private static InetAddress getInetAddress() {
        try {/*  www  .  j  a v  a2 s  . c  o m*/
            return InetAddress.getLocalHost();
        } catch (UnknownHostException e) {
            hostName = "unknown host!";
        }
        return null;

    }
}

Related

  1. getHostName(InetAddress address)
  2. getHostName(InetAddress ia)
  3. getHostNameReliably(final String requestingHost, final InetAddress site, final URL requestingUrl)
  4. getHostNameWithoutDomain(final InetAddress addr)
  5. getInetAddress()
  6. getInetAddress()
  7. getInetAddress()
  8. getInetAddress(final int[] octets, final int offset, final int length)
  9. getInetAddress(final String addressOrName)