Sure. It is follows correct syntax. Notice that it is doing integer division, though. Possibly a better statement would be:
double avg = (double)ArrayOps.sumElements( ar1 ) / ar1.length ;
You have reached the end of the chapter. Click on one of the following if you wish to review some method.
printRange()
method.)
sum()
method.)
The next chapter discusses how methods can change the values in an array.