About 177,000 results
Open links in new tab
  1. What is the difference between Integer and int in Java?

    Integer is a class, no different from any other in the Java language. Variables of type Integer store references to Integer objects, just as with any other reference (object) type. …

  2. java - Using int vs Integer - Stack Overflow

    I came across a class using Integer variables to capture size to be used in a for loop. Is this good practice or should we use the int primitive data type? Integer size = something.getFields().siz...

  3. java - Which one to use, int or Integer - Stack Overflow

    May 11, 2017 · In this data transfer object, I need to declare a numeric field. For that which one is better - int or Integer If I am defining the field as Integer, will there be any performance impact …

  4. java - Difference between int and Integer - Stack Overflow

    May 19, 2016 · An Integer is a Java object that wraps an int in a Class with lots of nice/helpful methods that can be called to work with that backing int hidden inside. This is the same with …

  5. java - Comparing performance of int and Integer - Stack Overflow

    Which one is best in programming—int or Integer? Especially whenever both are doing the same task. I am writing an application in Java. In most of the places of primitive data types, I use int; …

  6. java - Integer vs int: with regard to memory - Stack Overflow

    Dec 7, 2011 · In general, the heap memory used by a Java object in Hotspot consists of: an object header, consisting of a few bytes of "housekeeping" information; memory for primitive fields, …

  7. Java: Integer equals vs. - Stack Overflow

    As of Java 1.5, you can pretty much interchange Integer with int in many situations. However, I found a potential defect in my code that surprised me a bit. The following code: Integer cdiCt = ....

  8. What is the difference between an int and an Integer in Java and …

    Aug 3, 2008 · In Java, the 'int' type is a primitive, whereas the 'Integer' type is an object. In C#, the 'int' type is the same as System.Int32 and is a value type (ie more like the java 'int'). An integer …

  9. 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 …

  10. int vs Integer comparison Java - Stack Overflow

    Aug 26, 2013 · int vs Integer comparison Java [duplicate] Asked 12 years, 3 months ago Modified 8 years, 11 months ago Viewed 93k times