calculate average using Java 8 Stream API. average = Arrays.stream(array).average().orElse(Double.NaN);. // print sum to the console.
確定! 回上一頁