Program Find The All Address Of Google


Program Find The All Address Of Google

Program

import java.net.*;
public class AllAddressesOfgoogle {
public static void main (String[] args) {
try {
InetAddress[] addresses = InetAddress.getAllByName("www.google.com");
for (int i = 0; i < addresses.length; i++) {
System.out.println(addresses[i]);
}
}
catch (UnknownHostException e) {
System.out.println("Could not find www.microsoft.com");
}
}
}









Output:

www.google.com/216.58.196.4
www.google.com/2404:6800:4007:1800:0:0:0:2004



Share:

0 comments