Top "Autoboxing" questions

Boxing is the process of using an object to wrap a primitive value so that it can be used as a reference object; extracting a previously-boxed primitive is called unboxing.

How to convert int[] into List<Integer> in Java?

How do I convert int[] into List<Integer> in Java? Of course, I'm interested in any other answer …

java arrays collections boxing autoboxing
How to properly compare two Integers in Java?

I know that if you compare a boxed primitive Integer with a constant such as: Integer a = 4; if (a < 5) …

java integer autoboxing
Integer value comparison

I'm a newbie Java coder and I just read a variable of an integer class can be described three different …

java integer int equals autoboxing
Comparing boxed Long values 127 and 128

I want to compare two Long objects values using if conditions. When these values are less than 128, the if condition …

java comparison autoboxing
How do I convert Double[] to double[]?

I'm implementing an interface that has functionality similar to a table that can contain an types of objects. The interface …

java arrays autoboxing
Why do people still use primitive types in Java?

Since Java 5, we've had boxing/unboxing of primitive types so that int is wrapped to be java.lang.Integer, and …

java primitive primitive-types autoboxing jdk1.5
Java convert Arraylist<Float> to float[]

How I can do that? I have an arraylist, with float elements. (Arraylist <Float>) (float[]) Floats_arraylist.toArray() …

java arrays casting arraylist autoboxing
Why do we use autoboxing and unboxing in Java?

Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. …

java autoboxing
Why does int num = Integer.getInteger("123") throw NullPointerException?

The following code throws NullPointerException: int num = Integer.getInteger("123"); Is my compiler invoking getInteger on null since it's static? That …

java integer nullpointerexception api-design autoboxing
Boolean != false

In Java, you would usually say that if(someBool != false) is the same as if(someBool) But what if someBool …

java boolean autoboxing