Methods with array of parameters in Java

static double getAvg(double... values) {
    if (values.length == 0) {
        return 0;
    }

    double sum = 0;
    for(double valuevalues){
        sum += value;
    }
    return sum/values.length;
}

double avg = getAvg(1, 2, 3, 4);
//avg is 2.5