Primitive wrapper class in Java: Difference between revisions

Content deleted Content added
m fixed wikilink for renamed article
Line 1:
In the [[Java programming language]], a '''primitive wrapper class''' is one of eight classes provided in the {{Javadoc:SE|package=java.lang|java/lang}} [[packagesJava in Javapackage|package]] to provide [[object-oriented programming|object]] [[Method (computer science)|methods]] for the eight [[primitive type]]s. All of the primitive wrapper classes in Java are [[immutable object|immutable]]. [[J2SE]] 5.0 introduced [[autoboxing]] of primitive types into their wrapper object, and automatic unboxing of the wrapper objects into their primitive value—the implicit conversion between the wrapper objects and primitive values.
 
Wrapper classes are used represent primitive values when an {{Javadoc:SE|java/lang|Object}} is required. The wrapper classes are used extensively with {{Javadoc:SE|java/util|Collection}} classes in the {{Javadoc:SE|package=java.util|java/util}} package and with the classes in the {{Javadoc:SE|package=java.lang.reflect|java/lang/reflect}} [[Reflection (computer science)|reflection]] package.