Answers for "how to generate equals and hashcode in intellij"

0

how to generate equals and hashcode in intellij

public boolean equals(Object o){
        if(this==o)return true;
        if(o==null||getClass()!=o.getClass())return false;

        FixedRateCurrencyExchangeService that=(FixedRateCurrencyExchangeService)o;

        if(Double.compare(that.rate,rate)!=0)return false;

        return true;
        }

public int hashCode(){
        long temp=rate!=+0.0d?Double.doubleToLongBits(rate):0L;
        return int(temp^(temp>>>32));
        }
Posted by: Guest on July-08-2020

Browse Popular Code Answers by Language