CSS font stacks & developer FAQs with Web standards

Premium service benefits

Your premium content subscription is a single payment that gives you:

  • Private login to full answers on your chosen subject
  • All future FAQ updates for your topic area
  • Optional email notification of new items
  • Priority attention on follow-up questions
Site navigation below

One of hundreds of answers available with our premium content service.

Part answer, see below for more

A: Assuming you have data values in a Java storage structure, the key part of the process is to iterate through the values, check and store the minimum and maximum values, the running total and number of data points. Lets take the simple case of an iterator over a set of DataPoint objects that have an int getValue() method.

This example has int variables for max, min, count, sum and a temporary dataValue. The initial value for max is set to Integer.MIN_VALUE so that any given value should exceed it, and min is set to Integer.MAX_VALUE. A float type is specified for the mean variable since integer division is likely to result in a fraction and the decimal part should be preserved.

… full answer hidden

Click for full answers

Premium members click below for full answer
How can I calculate minimum, maximum and average using Java?

Home · Web fonts · Font stacks · FAQs · Java · CSS · Javascript · HTML · Site manager