Advertisement

Boxing and Unboxing

  • Mikael Olsson
Chapter

Abstract

Placing a primitive variable in an object is known as boxing. This allows the primitive to be used where objects are required. For this purpose Java provides wrapper classes for each primitive – namely: Byte, Short, Integer, Long, Float, Double, Character and Boolean. An Integer object, for example, can hold a variable of the type int.

Keywords

Programming Technique Object Type Performance Penalty Primitive Type Primitive Variable 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Mikael Olsson 2013

Authors and Affiliations

  • Mikael Olsson
    • 1
  1. 1.AlandFinland

Personalised recommendations