How to use Autoboxing and Unboxing in Java with Example

Tutorials Shared by the Internet Community

Advertisements


Synopsis

Autoboxing is introduced in JDK 5 and allows automatic conversion of primitive to Object type. There are subtle details about auto boxing which is req

Statistics

  • Total Hits - 27274

  • Total Votes - 137 votes

  • Vote Up - 64 votes

  • Vote Down - 73 votes

  • Domain - javarevisited.blogspot.sg

  • Category - JAVA/Core JAVA

  • Submitted By - Javin Paul

  • Submitted on - 2012-12-24 15:29:24

Description

Autoboxing in Java brings lot more things into table, sure it reduce boiler plate code for converting between primitive and wrapper classes but it does require good understanding of when and how autoboxing and unboxing occur in Java. careless use of autoboxing not only affect performance but introduces subtle bugs which are hard to find. ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements