🎴 Flashcard Mode
Software Architecture and Design Fundamentals
Card1 / 20
Mastered0
Review0
QuestionClick to flip
How do you change the value that is encapulsated by a wrapper class after you have instantiated it ?
AnswerClick to flip back
A
The value encapsulated by a wrapper class is immutable.
💡 Explanation:
Java wrapper classes are immutable, meaning their values cannot be changed after instantiation. Methods like setXXX() do not exist on wrapper classes. To work with a different value, you must create a new wrapper instance. This design ensures thread safety and allows for caching of frequently used values.