0% found this document useful (0 votes)
30 views

Ajp 14

This Java program uses the InetAddress class to get the IP address of the local host, a specific host, and all IP addresses associated with a domain name. It prints the local host address, a specific host address, and each of the IP addresses resolved from the given domain name.

Uploaded by

Ganesh Ekambe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Ajp 14

This Java program uses the InetAddress class to get the IP address of the local host, a specific host, and all IP addresses associated with a domain name. It prints the local host address, a specific host address, and each of the IP addresses resolved from the given domain name.

Uploaded by

Ganesh Ekambe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

NAME : KALP DESAI

ROLL NO : 08
PR NO : 14
import java.net.*;
class IP
{
public static void main(String args[])throws UnknownHostException
{
InetAddress Address=InetAddress.getLocalHost();
System.out.println("Address");
Address=InetAddress.getByName("starwave.com");
System.out.println("Address");
InetAddress sw[]=InetAddress.getAllByName("www.google.com");
for(int i=0;i<sw.length;i++)
{

System.out.println(sw[i]);
}

}
}

You might also like