import java.net.*;
class InetDemo
{
public static void main(String arg[])
{
try
{
InetAddress local=InetAddress.getLocalHost();
System.out.println("Ip address of local pc="+local);
InetAddress remote =InetAddress.getByName("fileserver");
System.out.println("ip address of remoten pc i.e. fileserver ip="+remote);
}
catch(UnknownHostException e)
{ System.out.println("error is DNS"+e);
}
}
}
No comments:
Post a Comment