IntSummaryStatistics accept() method in Java with Examples Last Updated : 27 Jun, 2019 Comments Improve Suggest changes Like Article Like Report The accept() method of IntSummaryStatistics class in Java is used to accept the given value into this summary information. Syntax: public void accept(int value) Parameter: This method accepts value as parameter that is to be recorded into this IntSummaryStatistics. Return Value: This method do not returns anything. Program: Java // Java program to demonstrate // the above method import java.util.*; public class IntSummaryStatisticsDemo { public static void main(String[] args) { IntSummaryStatistics intSummaryStatistics = new IntSummaryStatistics(); List<Integer> list = Arrays.asList(10, 20, 30, 40, 50); Iterator<Integer> iterator = list.listIterator(); while (iterator.hasNext()) { // Add the integers to the IntSummaryStatistics object intSummaryStatistics.accept(iterator.next()); } System.out.println(intSummaryStatistics.toString()); } } Output: IntSummaryStatistics{count=5, sum=150, min=10, average=30.000000, max=50} Reference: https://docs.oracle.com/javase/10/docs/api/java/util/IntSummaryStatistics.html#accept(int) Comment More infoAdvertise with us Next Article IntSummaryStatistics accept() method in Java with Examples S ShubhamMaurya3 Follow Improve Article Tags : Misc Java Java - util package Java-Functions Java-IntSummaryStatistics +1 More Practice Tags : JavaMisc Similar Reads IntSummaryStatistics getMin() method in Java with Examples The getMin() method of IntSummaryStatistics class in Java is used to get the minimum of records in this IntSummaryStatistics. Syntax: public int getMin() Parameter: This method do not accept any value as parameter. Return Value: This method returns the minimum of the records in this IntSummaryStatis 1 min read IntSummaryStatistics getSum() method in Java with Examples The getSum() method of IntSummaryStatistics class in Java is used to get the sum of records in this IntSummaryStatistics. Syntax: public long getSum() Parameter: This method do not accept any value as parameter. Return Value: This method returns the sum of the records in this IntSummaryStatistics. P 1 min read IntSummaryStatistics getMax() method in Java with Examples The getMax() method of IntSummaryStatistics class in Java is used to get the maximum of records in this IntSummaryStatistics. Syntax: public int getMax() Parameter: This method do not accept any value as parameter. Return Value: This method returns the maximum of the records in this IntSummaryStatis 1 min read LongSummaryStatistics accept(int) method in Java with Examples The accept(int) method of LongSummaryStatistics class in Java is used to accept the given integer value into this summary information. Syntax: public void accept(int value) Parameter: This method accepts value as parameter that is to be recorded into this LongSummaryStatistics. Return Value: This me 1 min read IntSummaryStatistics getCount() method in Java with Examples The getCount() method of IntSummaryStatistics class in Java is used to get the count of records in this IntSummaryStatistics. Syntax: public long getCount() Parameter: This method do not accept any value as parameter. Return Value: This method returns the count of the records in this IntSummaryStati 1 min read IntSummaryStatistics toString() method in Java with Examples The toString() method of IntSummaryStatistics class in Java is used to get the String representation of records in this IntSummaryStatistics. Syntax: public long toString() Parameter: This method do not accept any value as parameter. Return Value: This method returns the String representation of the 1 min read IntSummaryStatistics getAverage() method in Java with Examples The getAverage() method of IntSummaryStatistics class in Java is used to get the average of records in this IntSummaryStatistics. Syntax: public double getAverage() Parameter: This method do not accept any value as parameter. Return Value: This method returns the average of the records in this IntSu 1 min read LongSummaryStatistics accept(long) method in Java with Examples The accept(long) method of LongSummaryStatistics class in Java is used to accept the given long value into this summary information. Syntax: public void accept(long value) Parameter: This method accepts value as parameter that is to be recorded into this LongSummaryStatistics. Return Value: This met 1 min read Java.util.IntSummaryStatistics class with Examples The IntSummaryStatistics class is present in java.util package. It takes a collection of Integer objects and is useful in the circumstances when we are dealing with a stream of integers. It maintains a count of the number of integers it has processed, their sum and various other statistics. The clas 3 min read LongSummaryStatistics getMin() method in Java with Examples The getMin() method of LongSummaryStatistics class in Java is used to get the minimum of records in this LongSummaryStatistics. Syntax: public int getMin() Parameter: This method do not accept any value as parameter. Return Value: This method returns the minimum of the records in this LongSummarySta 1 min read Like