InetAddress
================
import java.net.*;
public class AllAddress{
public static void main (String[] args) {
try {
InetAddress[] addresses =
InetAddress.getAllByName("www.microsoft.com");
for (int i = 0; i < addresses.length; i++) {
System.out.println(addresses[i]);
}
}
catch (UnknownHostException ex) {
System.out.println("Could not find www.microsoft.com");
}
}
}
contoh path dan menjalankan java pada Command Prompt DOS ( CMD ) ada di klik
Tidak ada komentar:
Posting Komentar