import java.net.*;
class Equal {
public static void main(String args[]) {
try {
InetAddress add1 = InetAddress.getByName("java.sun.com");
InetAddress add2 = InetAddress.getByName("www.sun.com");
if (add1.equals(add2)) {
System.out.println("Hai dia chi nay co cung IP");
}
else {
System.out.println("Hai dia chi nay khac IP");
}
}
catch (UnknownHostException ex) {
System.out.println("Khong the tim thay host.");
}
}
}