About "InetAddress" class

Hello,I want to know how to get the host_name and ip through "InetAddress" class in JVMThanks!
[115 byte] By [THE_GUYa] at [2007-9-25]
# 1

> Hello,

> I want to know how to get the host_name and ip

> through "InetAddress" class in JVM

Don't know what you mean by in JVM.

But just in case...

[url=http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html#getHostAddress()]getHostAddress()[/url] returns the IP address string in textual presentation.

[url=http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html#getHostName()]getHostName()[/url] gets the host name for this IP address.

TimTheEnchantora at 2007-7-14 > top of java,Core,Core APIs...
# 2
Try the Javadoc.
ejpa at 2007-7-14 > top of java,Core,Core APIs...
# 3
I mean how method "getHostAddress()" works to get the host address. Actually, I know this mehod can get the host address, and I am just interested with how it gets "the address".
THE_GUYa at 2007-7-14 > top of java,Core,Core APIs...
# 4
It uses native calls which in turn query the appropriate memory address.
jverda at 2007-7-14 > top of java,Core,Core APIs...