• 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();
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!