|
The primitive value wrapped by a wrapper object cannot be changed. For example, once the Integer object wraps the value 45, it will always hold this value. Hence, this object is immutable, as there is no way you can change its value to something other than 45.
|
|
Be careful with exam question that shows the immutable objects such as wrapper objects or string objects changing their values using fake methods such as setValue() etc. Remember that the value of immutable object can never be changed. |