In this Example you will learn how to get host name in Java. Go through the below given code to understand how it works and gets the host name of a computer or an IP address using Java application language.
The given program will first check Java's Security Manager to ensure if the hostname search is permitted or not. Although, it is allowed on most standard environments by default.
Here is the video tutorial of "How to get Host Name in Java?":
Java code to get host name
Output will be displayed as:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: October 15, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles