I have an array of double values. I would like to calculate the maximum and average of all the values in this array.
Currently, I'm just looping through an array and calculating numbers, and everything is working fine. But it seems strange to me that I have to implement such basic methods. I searched in the Java API if there is a way that can do something similar, but I could not find ... Am I missing something?
I searched here, but I only found a bunch of examples where they implement it the same way I do.
source
share