Forums Register Login

Please Help on: Autoboxing-Widening

+Pie Number of slices to send: Send
Can anyone help me to provide correct answer:

Which one get preference on "Widening" or "AutoBoxing/Unboxing"

for example:


is it long converted to float ? I am confisued!
+Pie Number of slices to send: Send
 

Originally posted by PK Ghosh:
Can anyone help me to provide correct answer:

Which one get preference on "Widening" or "AutoBoxing/Unboxing"

for example:


is it long converted to float ? I am confisued!



Remember that autoboxing will occur when a primitive needs to be treated like an object.

When you use the == between a primitive and a wrapper, then the wrapper will be unboxed first.
+Pie Number of slices to send: Send
Thanks Keith Lynn.
+Pie Number of slices to send: Send
Thanks Keith Lynn.
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 782 times.
Similar Threads
Wrapper Assignments from ExamLab
Confused
Method Overloading
Widening,Boxing and Var-Args Combined
question about primitive type and wrapper class
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:48:39.