Answers for "how to get the average from a list in java"

0

how to get the average from a list in java

private double calculateAverage(List <Integer> marks) {
    return marks.stream()
                .mapToDouble(d -> d)
                .average()
                .orElse(0.0)
}
Posted by: Guest on June-10-2021

Code answers related to "how to get the average from a list in java"

Browse Popular Code Answers by Language