InetAddress to String

Question:
Is it possible to convert from java.net.InetAddress to string?

Answer:
Yes. Just call the InetAddress toString() method. Also, if you specifically want the host name, use getHostName. If you want a string representation of the IP address, use getHostAddress().

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: