Primitive wrapper class in Java: Difference between revisions

Content deleted Content added
Chip Zero (talk | contribs)
Atomic wrapper classes: expand to list all of the atomic wrapper classes
Line 33:
== Atomic wrapper classes ==
 
With Java 5.0, additional wrapper classes were introduced in the {{Javadoc:SE|package=java.util.concurrent.atomic|java/util/concurrent/atomic}} package,. such asThese theclasses {{Javadoc:SE|java/util/concurrent/atomic|AtomicInteger}}are class. These classesmutable cannot be used as a replacement for the regular wrapper classes,. and are not immutable. Instead, they provide [[atomic operation]]s such asfor addition, increment and incrementassignment.
 
The atomic wrapper classes and their corresponding primitive types are:
 
:{| class="wikitable"
! Primitive type !! Wrapper class
|-
| <code>int</code> || {{Javadoc:SE|java/util/concurrent/atomic|AtomicInteger}}
|-
| <code>long</code> || {{Javadoc:SE|java/util/concurrent/atomic|AtomicLong}}
|-
| <code>boolean</code> || {{Javadoc:SE|java/util/concurrent/atomic|AtomicBoolean}}
|-
| <code>V</code> || {{Javadoc:SE|class=AtomicReference<V>|java/util/concurrent/atomic|AtomicReference}}
|}
 
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 "[[Generic programming#Generics in Java]]" for a description of type parameters in Java.)
 
== See also ==