Java Utililty Methods Loopback Address Get

List of utility methods to do Loopback Address Get

Description

The list of methods to do Loopback Address Get are organized into topic(s).

Method

InetAddressgetLoopBackAddress()
get Loop Back Address
return InetAddress.getByName("127.0.0.1");
StringgetLoopbackAddress()
get Loopback Address
try {
    return InetAddress.getByName("localhost").getHostAddress();
} catch (UnknownHostException e) {
    throw new RuntimeException(e);
InetAddressgetLoopbackAddress()
Get the loopback interface name.
try {
    for (NetworkInterface netIf : Collections.list(NetworkInterface.getNetworkInterfaces())) {
        if (netIf == null) {
            continue;
        if (netIf.isLoopback()) {
            Enumeration<InetAddress> addrs = netIf.getInetAddresses();
            while (addrs.hasMoreElements()) {
...