Javatpoint Logo
Javatpoint Logo

Java InetAddress getHostAddress() method

The getHostAddress() method of InetAddress class returns the IP address string in textual presentation.

Syntax:

Returns

It returns the raw IP address in a string format.

Example 1

Test it Now

Output:

172.17.0.2

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