JAVA-MANI.BLOGSPOT.COM
Wednesday, September 17, 2008
import java.net.InetAddress;
import java.net.UnknownHostException;

public class HostnameExample
{
public static void main(String[] args)
{
try
{
InetAddress address = InetAddress.getLocalHost();

System.out.println("Hostname: " + address.getHostName());
} catch (UnknownHostException e)
{
e.printStackTrace();
}
}
}

0 comments:

SUBSCRIBE VIA eMAIL

Enter your email address:

Delivered by FeedBurner

Recent Posts

Firefox 3

Counter

internet companies

Live Traffic Map

Subscribe Now