• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InetAddress and getLocalHost

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
what is InetAddress and getLocalHost? If somebody can explain me with example. Do we have write IP address in InetAddress or not?
Thanks in advance,
Angela
 
aarti sharma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to get the IP address of your machine u can use getLocalHost()
eg.
InetAddress l=InetAddress.getLocalHost();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic