Are all primitive wrapper classes in Java immutable objects? String is immutable. What are the other immutable objects?
Before Java 5, all the primitive wrapper classes were immutable.
However, the atomic wrapper classes introduced in Java 5 (AtomicInteger, AtomicLong, AtomicBoolean and AtomicReference) are mutable.
AtomicInteger
AtomicLong
AtomicBoolean
AtomicReference