• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Java 2 v5.0 (Tiger) New Features by Herbert Schildt

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Autoboxing/unboxing change the interplay between primitive types and objects by providing automatic wrapping and unwrapping of primitive values. This occurs behind the scenes. Although easy to use, and a great new feature in my opinion, it also introduces potential side effects



Does this mean you don't have to use classes like Integer to convert a primitive int to a long through the method Integer.longValue()? How would you do this with Java v5.0?
 
Author
Posts: 253
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keith:

No, you would still use techniques such as Integer.longValue(). Autoboxing does not provide for conversions between types. It simply automatically wraps a primitive into its corresponding type wrapper.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic