Code example for InetAddress

Methods: getHostAddress, getHostName

0
        this.ip = ip;
        this.name = name;
    } 
 
    public Host(InetAddress address) {
        this(address.getHostAddress(), address.getHostName());
    } 
 
    public String getIp() {
        return ip;
    } 
 
    public String getName() {
        return name;
    } 
 
    public int hashCode() { 
        return (ip == null ? 0 : ip.hashCode())
                ^ (name == null ? 0 : name.hashCode());
    }