public int hashCode(){
  return Objects.hash(y,p,g);
}

public int hashCode ( ) { return Objects . hash ( y , p , g ) ; }
calculates a hash code value for the object . objects that are equal will also have the same hashcode .
