About 8,490,000 results
Open links in new tab
  1. java - max value of integer - Stack Overflow

    Feb 21, 2013 · To get the max and min values of int in Java, use Integer.MAX_VALUE and Integer.MIN_VALUE

  2. Java Long primitive type maximum limit - Stack Overflow

    I am using the long primitive type which increments by 1 whenever my generateNumber method is called. What happens if long reaches its maximum value? Will it throw any exception or will it …

  3. java - Change priorityQueue to max priorityqueue - Stack Overflow

    int compare(T o1, T o2) Default compare method returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. The Default …

  4. How is the default max Java heap size determined?

    For Java SE 5: According to Garbage Collector Ergonomics [Oracle]: initial heap size: Larger of 1/64th of the machine's physical memory on the machine or some reasonable minimum. …

  5. Finding the max/min value in an array of primitives using Java

    Sep 28, 2009 · If you have an array of one of those, you can find the min or max using Arrays.stream(). A comprehensive solution to the problem of reductions over primitive arrays is …

  6. Finding Key associated with max Value in a Java Map

    May 6, 2011 · What is the easiest way to get key associated with the max value in a map? I believe that Collections.max(someMap) will return the max Key, when you want the key that …

  7. java - How to find the maximum value in an array? - Stack Overflow

    In java, i need to be able to go through an array and find the max value. How would I compare the elements of the array to find the max?

  8. java - Difference between @size (max = value ) and @min (value) …

    @Min and @Max are used for validating numeric fields which could be String (representing number), int, short, byte etc and their respective primitive wrappers. @Size is used to check …

  9. java - Explanation on Integer.MAX_VALUE and Integer.MIN_VALUE …

    Jun 7, 2015 · I don't seem to understand how Integer.MAX_VALUE and Integer.MIN_VALUE help in finding the min and max value in an array. I understand how this method (pseudocode …

  10. How do I generate a random integer between min and max in Java?

    19 You can use Random.nextInt (n). This returns a random int in [0,n). Just using max-min+1 in place of n and adding min to the answer will give a value in the desired range.