I'm new to java, never programmed before, and I'm having some trouble with this code. It tells me that it requires a int[] value, but is getting a int value. I'm not too sure how to fix this.

Thank you in advance for any help you can provide.

Here is the section of code:

public static int[] createBucketCounts(double [] data, int n) {
double min = DescriptiveStatistics.getMinimum(data);
double max = DescriptiveStatistics.getMaximum(data);
double range = max - min;
double width = range / 10;

int[] bucketCounts ={
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

for (int i = 0; i < data.length; i++){
if (data[i] <= min + width){
return bucketCounts[0] += 1;
}
else if (data[i] <= min + (width * 2)){
return bucketCounts[1] += 1;
}
else if (data[i] <= min + (width * 3)){
return bucketCounts[2] += 1;
}
else if (data[i] <= min + (width * 4)){
return bucketCounts[3] += 1;
}
else if (data[i] <= min + (width * 5)){
return bucketCounts[4] += 1;
}
else if (data[i] <= min + (width * 6)){
return bucketCounts[5] += 1;
}
else if (data[i] <= min + (width * 7)){
return bucketCounts[6] += 1;
}
else if (data[i] <= min + (width * 8)){
return bucketCounts[7] += 1;
}
else if (data[i] <= min + (width * 9)){
return bucketCounts[8] += 1;
}
else if (data[i] <= min + (width * 10)){
return bucketCounts[9] += 1;
}
return bucketCounts;
}

} // end of createBucketCounts