public override Int32 GetHashCode() { unchecked { return((WeightInGrams.GetHashCode() * 397) ^ DiameterinMillimeters.GetHashCode()); } }
public override int GetHashCode() { int hash = WeightInGrams.GetHashCode(); hash = (hash * 31) + AgeInMonths.GetHashCode(); return(hash); }
public override int GetHashCode() { int hash = 17; hash = (hash * 23) + Name.GetHashCode(); hash = (hash * 23) + Type.GetHashCode(); hash = (hash * 23) + WeightInGrams.GetHashCode(); return(hash); }
public override int GetHashCode() { unchecked { int hash = 31; hash = hash * 23 + Name.GetHashCode(); hash = hash * 23 + Type.GetHashCode(); hash = hash * 23 + WeightInGrams.GetHashCode(); hash = hash * 23 + AgeInMonths.GetHashCode(); return(hash); } }
public override string ToString() { return($"{Name}, Breed {Type}, Months {AgeInMonths}, weight {WeightInGrams.ToString("D", currentCulture )}"); }
public int CompareTo(Duck other) { return(WeightInGrams.CompareTo(other.WeightInGrams)); }