This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Please Help on: Autoboxing-Widening Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Please Help on: Autoboxing-Widening" Watch "Please Help on: Autoboxing-Widening" New topic
Author

Please Help on: Autoboxing-Widening

PK Ghosh
Greenhorn

Joined: Aug 08, 2006
Posts: 24
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!
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
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.
PK Ghosh
Greenhorn

Joined: Aug 08, 2006
Posts: 24
Thanks Keith Lynn.
PK Ghosh
Greenhorn

Joined: Aug 08, 2006
Posts: 24
Thanks Keith Lynn.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please Help on: Autoboxing-Widening