Rainfall class program

The problem

Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following:

Demonstrate the class in a complete program and use java 8 examples to do so. Input Validation: Do not accept negative numbers for monthly rainfall figures.

Breaking it down

RainfallClass

private double[] rain;

public RainfallClass(double r[]) {

    // Create a new array.
    rain = new double[r.length];

    for (int i = 0; i < r.length; i++) {
        rain[i] = r[i];
    }
}

public double getTotalRainFall() {
    return Arrays.stream(rain).sum();
}

public double getAverageRainFall() {
    return Arrays.stream(rain).average().getAsDouble();
}

public int getHighestMonth() {

    int highest = 0;

    // Find the element with the highest value.
    for (int i = 1; i < rain.length; i++) {
        if (rain[i] > rain[highest])
            highest = i;
    }

    // Return the element number.
    return highest;
}

public int getLowestMonth() {
    int lowest = 0;

    // Find the element with the lowest value.
    for (int i = 1; i < rain.length; i++) {
        if (rain[i] < rain[lowest])
            lowest = i;
    }
    // Return the element number.
    return lowest;
}

public double getRainAt(int e) {
    return rain[e];
}

Program

public static void main(String[] args) {
    
    // Array representing rainfall figures
    // position correlates to the month
    double[] thisYear = { 1.6, 2.1, 1.7, 3.5, 2.6, 3.7, 3.9, 2.6, 2.9, 4.3,
            2.4, 3.7 };

    RainfallClass r = new RainfallClass(thisYear);

    // Display the statistics.
    System.out.println("The total rainfall for this year is "
            - r.getTotalRainFall());
    System.out.println("The average rainfall for this year is "
            - r.getAverageRainFall());
    
    int high = r.getHighestMonth();
    System.out.println("The month with the highest amount of rain " + "is "
            - (high + 1) + " with " + r.getRainAt(high) + " inches.");
    int low = r.getLowestMonth();
    System.out.println("The month with the lowest amount of rain " + "is "
            - (low + 1) + " with " + r.getRainAt(low) + " inches.");
}

Output

The total rainfall for this year is 35.0
The average rainfall for this year is 2.9166666666666665
The month with the highest amount of rain is 10 with 4.3 inches.
The month with the lowest amount of rain is 1 with 1.6 inches.