About 51 results
Open links in new tab
  1. integer - The range of int in Java - Stack Overflow

    I understand that the int range in Java should be -2^31 to 2^31-1. But when I run this code snippet with 20: public class Factorial { public int factorial(int n) { int fac=1; fo...

  2. How can I represent a range in Java? - Stack Overflow

    Range<Integer> test = Range.between(1, 3); System.out.println(test.contains(2)); System.out.println(test.contains(4)); Guava Range has similar API. If you are just wanting to check if …

  3. java - How to calculate the range of primitive data types ... - Stack ...

    Range of data types so now we came to know that how we are calculating the Range of the integer data types.This logic is applicable for all the integer data types.

  4. java - How to check if an integer is in a given range? - Stack Overflow

    How to check if an integer is in a given range? Asked 14 years, 11 months ago Modified 12 months ago Viewed 364k times

  5. java - Long vs Integer, long vs int, what to use and when? - Stack …

    May 2, 2011 · Java.util.collections methods usually use the boxed (Object -wrapped) versions, because they need to work for any Object, and a primitive type, like int or long, is not an Object. Another …

  6. java - max value of integer - Stack Overflow

    Feb 21, 2013 · For int, this minimum range is -32767 to 32767, meaning an int must be at least 16 bits wide. An implementation is free to provide a wider int type with a correspondingly wider range. For …

  7. lambda - Java 8 IntStream for an int range? - Stack Overflow

    Feb 4, 2015 · Is there a way to create an IntStream for a range of ints? Like if I wanted to stream values 1 to 1000, I could invoke some IntStream static factory to stream that range? IntStream.forRange(1, 1...

  8. Java: Equivalent of Python's range (int, int)? - Stack Overflow

    Sep 24, 2010 · I'm working on a little Java utils library called Jools, and it contains a class Range which provides the functionality you need (there's a downloadable JAR). Constructors are either Range(int …

  9. java - For loop - like Python range function - Stack Overflow

    May 15, 2013 · I was wondering if in Java there is a function like the python range function. range(4) and it would return [0,1,2,3] This was an easy way to make for enhanced loops. It would be great to do this...

  10. Setting a range for an Integer in Java - Stack Overflow

    Dec 7, 2011 · 0 An Integer (int) does not have any constraints by itself, the only one are the minimum and maximum values bounded by the cardinality of a 32bit set. The method you are talking about is …