socket_getAllByName.htm

import java.io.*;
//import java.util.*;
import java.net.*;
class Test_this {
public static void main(String args[])throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("-->Welcome to socket building<--");
System.out.print("type host name ");
String str = br.readLine();
process_this pt = new process_this();
pt.method_socket_address(str);
}
}
class process_this
{
//public String str = "manas6";
public void method_socket_address(String str2)throws IOException
{
InetAddress[] address = InetAddress.getAllByName(str2);
for(int i = 0; i <address.length; i++)
{
System.out.println("Networking Host is http:// "+ address[i]);
}
}
}