Java InetAddress getLoopbackAddress() methodThe getLoopbackAddress() method of Java InetAddress class returns the loopback address. It will return the local-only, loopback address whereas getLocalHost() method will return the address registered with the machine name. Syntax:ReturnsThe getLoopbackAddress() method returns the InetAddress loopback instance. Example 1Test it NowOutput: Address is 127.0.0.1
Next TopicInetAddress Class
|