About 6,470,000 results
Open links in new tab
  1. java - How do I get the max and min values from a set of numbers ...

    Here's a possible solution: public static void main(String [] args) { int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; Scanner s = new Scanner(System.in); while (true) { …

  2. Min and Max in a List in Java - GeeksforGeeks

    Jan 11, 2023 · Given an unsorted list of integers, find maximum and minimum values in it. Input : list = [10, 4, 3, 2, 1, 20] Output : max = 20, min = 1 Input : list = [10, 400, 3, 2, 1, -1] Output : …

  3. Finding Max/Min of a List or Collection - Baeldung

    Apr 4, 2025 · In this quick article, we explored how the max() and min() methods from the Java 8 Stream API can be used to find the maximum and minimum value from a List or Collection. …

  4. Java 8 Program to Find the Maximum Number and Minimum Number

    This blog post will demonstrate how to use Java 8 Streams to find the maximum and minimum numbers in a list. Streams in Java 8 provide a high-level abstraction for processing sequences …

  5. Find Max and Min in an Array in Java - HowToDoInJava

    Feb 21, 2023 · Learn ways to find the maximum and the minimum element from an Array in Java using Stream API, Collections, simple iterations and recursion.

  6. Find minimum and maximum elements in an array in Java

    Jan 14, 2022 · This post will discuss how to find the minimum and maximum element in an array in Java. 1. Using List. If the given array is a non-primitive array, we can use Arrays.asList() …

  7. Find Min & Max Numbers in a Java Array - Online Tutorials …

    Learn how to find the minimum and maximum numbers in a Java array with clear examples and explanations.

  8. How to search max and min values in java - Stack Overflow

    Sep 9, 2014 · For finding the max and min, maintain two variable, int min and int max initialise with say value[0] and value[1], start iterating from i=2 to the value.length. As you iterate update …

  9. Find max or min value in an array of primitives using Java

    Apr 9, 2025 · To get the minimum or maximum value from the array we can use the Collections.min() and Collections.max() methods. But as this method requires a list type of …

  10. Java – Finding minimum and maximum values in an array

    Sep 11, 2022 · In this example we are finding out the maximum and minimum values from an int array. class MinMaxExample { public static void main(String args[]){ int array[] = new int[]{10, …

  11. Some results have been removed