Boxing (computer programming): Difference between revisions

Content deleted Content added
write an article
 
boxing merged
Line 3:
Some [[object-oriented programming language]] make an distinction betweeen objects an non-objects, often referred to as [[primitive type]]s for reasons such as runtime efficiency and syntax or semantic issues. For example, [[Java programming language|Java]] has object types corresponding to each primitive types. Such are <code>Integer</code> and <code>Character</code>. In languages like [[C Plus Plus|C++]] that make little or no distinction between objects and non-objects, the use of object type is of little interest.
 
'''Boxing''' is a way to wrap [[object (computer science)|object]]s with [[primitive type]]s over [[object type]]s so that those can be used like objects. Examples are [[Integer]] class for integer type in [[Java programming language|Java]]. Some languages require programmers to do boxing manually, while some support '''autoboxing'''/'''unboxing'''.
The automatical conversion between object types and non-object types are called [[automatic boxing]].