public void calculateMax(double max){
  this.max=Math.max(this.max,max);
}

public void calculateMax ( double max ) { this . max = Math . max ( this . max , max ) ; }
sets the maximum if the given value is bigger than the current value .
