IntSummaryStatistics getMin() method in Java with ExamplesThe Java IntSummaryStatistics class's getMin() function is used to determine the minimum number of records in this IntSummaryStatistics. Syntax: Parameter: There are no values that can be passed as parameters to this method. Return Value: The minimal number of records in this IntSummaryStatistics are returned by this method. Example 1:The given Java program shows how to gather and extract statistical data from an integer stream using the IntSummaryStatistics class. A set of integers is used by the software to initialize an IntStream. Then, it collects several statistics into an IntSummaryStatistics object using the summaryStatistics() function, including count, total, average, maximum, and minimum values. The getMin() function is used to obtain the stream's minimum value. Implementation: FileName: MinimumSummaryExample1.java Output: The Minimum value from the IntStream is given by : 5 Example 2:The program shows how to determine the minimal value in a list of integers using IntSummaryStatistics. It starts by initializing a list of integers and an IntSummaryStatistics object. The accept() method is used to add each integer to the IntSummaryStatistics object once an iterator has traversed the list. The getMin() method is used to obtain the minimum value once all integers have been processed. Implementation: FileName: MinimumSummaryExample2.java Output: The Minimum value from the IntStream is given by : 5 |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India