//knowing IPAddress of a website

import java.io.*;

import java.net.*;

class Address


public static void main(String args[]) throws IOException


//accept the name of the website from keyboard

Buffereder br = new BufferedReader (new InputStreamReader(System.in));

System.out.print(“Enter the name of the website”);

String site = br.readLine();


//getByName() method accept site name and returns it’s ip address

InetAddress ip = InetAddress.getByName(site);

System.out.println(“The IP Address is:  ” + ip);

}catch(UnknownHostException ue)


System.out.println(“website not found”);






c:\>javac Address.java

c:\>java Address

Enter the name of the website: http://www.yahoo.com

The IP Address is:www.yahoo.com/