Content deleted Content added
FR30799386 (talk | contribs) No edit summary Tags: Mobile edit Mobile web edit |
Sammi Brie (talk | contribs) Adding intentionally blank description, overriding Wikidata description "computer term referring to a Java class in object-oriented programming" |
||
(13 intermediate revisions by 12 users not shown) | |||
Line 1:
{{Short description|none}}
In [[object
Primitive wrapper classes are used to create an {{Javadoc:SE|java/lang|Object}} that needs to represent primitive types in {{Javadoc:SE|java/util|Collection}} classes (i.e., in the Java API), in the {{Javadoc:SE|package=java.util|java/util}} package and in the {{Javadoc:SE|package=java.lang.reflect|java/lang/reflect}} [[Reflection (computer science)|reflection]] package. Collection classes are Java API-defined classes that can store objects in a manner similar to how data structures like arrays store primitive data types like '''int''', '''double''', '''long''' or '''char''', etc.,<ref name=murach/> but arrays store primitive data types while collections actually store objects.
Line 30 ⟶ 31:
Therefore, the term ''Primitive wrapper class'' does not mean that wrapper classes are primitive types. It should be understood to be a class that wraps primitive types. Wrapper classes can be used to store the same value as of a primitive type variable but the instances/objects of wrapper classes themselves are ''Non-Primitive''. We cannot say that Wrapper classes themselves are Primitive types. They just wrap the primitive types.
The <code>Byte</code>, <code>Short</code>, <code>Integer</code>, <code>Long</code>, <code>Float</code>, and <code>Double</code> wrapper classes are all [[subclass (computer science)|subclass]]es of the {{Javadoc:SE|java/lang|Number}} class.
The wrapper classes <code>BigDecimal</code> and <code>BigInteger
| url = http://www.javaranch.com/journal/2003/04/immutable.htm
| title = Mutable and Immutable Objects: Which classes are Immutable?
Line 69:
The <code>AtomicInteger</code> and <code>AtomicLong</code> classes are subclasses of the <code>Number</code> class. The <code>AtomicReference</code> class accepts the [[TypeParameter|type parameter]] <code>V</code> that specifies the type of the object [[reference (computer science)|reference]]. (See "[[Generics in Java]]" for a description of type parameters in Java).
== See also ==
|