Hi there,
I have a class definition like :
class Student{
String name;
int sub1;
int sub2;
int sub3;
//...
}
I have list of all students.
I want to get count, average, min, max etc using IntSummaryStatistics.
Below is the code for sub1:
IntSummaryStatistics sub1Summary = students.stream().collect(Collectors.summarizingInt(s -> s.sub1));
I want to have same for all other subjects.
Is it posible to have single line expression to do this?
Or I will have to create different IntSummaryStatiscs object for each subject?