Javatpoint Logo
Javatpoint Logo

Java InetAddress getLoopbackAddress() method

The 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:

Returns

The getLoopbackAddress() method returns the InetAddress loopback instance.

Example 1

Test it Now

Output:

 Address is 127.0.0.1

Next TopicInetAddress Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA