
Finding the max/min value in an array of primitives using Java
Mar 13, 2015 · The basic way to get the min/max value of an Array. If you need the unsorted array, you may create a copy or pass it to a method that returns the min or max. If not, sorted array is better since it performs faster in some cases.
java - How to find the maximum value in an array ... - Stack Overflow
Java program to find max value in an array is printing multiple values (19 answers) Closed 11 years ago . In java, i need to be able to go through an array and find the max value.
Java Minimum and Maximum values in Array - Stack Overflow
Aug 26, 2016 · My code does not give errors, however it is not displaying the minimum and maximum values. The code is: Scanner input = new Scanner(System.in); int array[] = new int[10]; System.out.println("Ent...
Finding Max value in an array using recursion - Stack Overflow
Oct 25, 2013 · For one of the questions i was asked to solve, I found the max value of an array using a for loop, so i tried to find it using recursion and this is what I came up with: public static int findMax(...
java - Can you use Math.max with an array? - Stack Overflow
Jun 26, 2014 · Java program to find max value in an array is printing multiple values. 1. printing the max of an array ...
java - How to find array index of largest value? - Stack Overflow
Apr 7, 2014 · The title above sums up my question, to clarify things an example is: array[0] = 1 array[1] = 3 array[2] = 7 // largest array[3] = 5 so the result I would like is 2, since it contains the largest
Finding minimum and maximum in Java 2D array - Stack Overflow
Your problem is: You are sorting the array of int arrays instead of sorting each individual int in each int array. To solve this: Loop through each int array in the array of int arrays. Instructions for finding the maximum and minimum of a 2D int array using Arrays.sort(): Declare a …
How to find maximum value from a stream of Integer values in …
Jul 13, 2015 · You may either convert the stream to IntStream:. OptionalInt max = list.stream().mapToInt(Integer::intValue).max();
Find the min/max element of an array in JavaScript
In 2016, ES7 or ES8 spec Array.max and Array.min. Unlike this version, they work on strings. Your future colleague tries to get the alphabetically-latest string in an array with the now-well-documented native .max() method, but mysteriously gets NaN. Hours later, she finds this code, runs a git blame, and curses your name. –
Max element of an array in Java - Stack Overflow
Mar 11, 2014 · Java program to find max value in an array is printing multiple values. 1. printing the max of an array ...