Top "Unboxing" questions

Unboxing is the opposite of boxing.

How to unbox from object to type it contains, not knowing that type at compile time?

At the run-time I get boxed instance of some type. How to unbox it to underlying type? Object obj; String …

c# unboxing
How does auto boxing/unboxing work in Java?

Since JDK 5.0, auto boxing/unboxing was introduced in Java. The trick is simple and helpful, but when I started testing …

java autoboxing unboxing
Casting object to int throws InvalidCastException in C#

I have this method: private static Dossier PrepareDossier(List<List<object>> rawDossier) { return new Dossier((int)…

c# casting unboxing
Why does autoboxing in Java allow me to have 3 possible values for a boolean?

Reference: http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html "If your program tries to autounbox null, it …

java wrapper primitive autoboxing unboxing
Comparing boxed value types

Today I stumbled upon an interesting bug I wrote. I have a set of properties which can be set through …

c# equality boxing unboxing
Method overload resolution in java

Here is what I know about overload resolution in java: The process of compiler trying to resolve the method call …

java overloading unboxing
Differences in auto-unboxing between Java 6 vs Java 7

I have noted a difference in auto unboxing behavior between Java SE 6 and Java SE 7. I'm wondering why that is, …

java casting java-7 unboxing
Integer auto-unboxing and auto-boxing gives performance issues?

We are currently doing some iterations and other operations using x++; where x is an Integer and not an int. …

java integer boxing unboxing
Integer wrapper class and == operator - where is behavior specified?

Integer integer1 = 127; Integer integer2 = 127; System.out.println(integer1 == integer2);//true integer1 = 128; integer2 = 128; System.out.println(integer1 == integer2);//false I found …

java comparison boxing unboxing
Boxing vs Unboxing

Another recent C# interview question I had was if I knew what Boxing and Unboxing is. I explained that value …

c# boxing unboxing