3.2 - Métodos da classe NovoTempo.java

 
    @Override
    public boolean equals(Object obj) {
        
        if(obj == null){
            return false;
        }
        
        if (obj == this){
            return true;
        }
        
        if( ! (obj instanceof NovoTempo)){
            return false;
        }
        
        NovoTempo t = (NovoTempo) obj;
        
        return this.totalDeSegundosDeUmDia == t.totalDeSegundosDeUmDia; 
    }
    
    @Override
    public int hashCode() {
        int r = 17;
        r = 31 * r + this.totalDeSegundosDeUmDia;
        return r;
    }

             
Copyright © 2016 AIEC.