I wanted to know some internal working of Integer class.
For example we can write:
Integer num = 9;
I wanted to know how an Integerclass is created in this case, as we have not created
any Object. How does it works internally?
This is called autoboxing, a feature introduced in Java 5. The Java compiler transforms your statement into:
Integer num = Integer.valueOf(9);
You can read more about autoboxing here:
This concept is called auto-boxing. The compiler will change your code to
Integer num = Integer.valueOf(9);
and continue compiling from there...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With