aspose file tools*
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
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