I have an integer array and I want to calculate the average of the values in it.
How to calculate average of array in Java?
You can iterate through the elements of array and then calculate sum. Then divide it with the length of the array.
This way you can achieve the result.
Check source code at Average of Array.