What is an immutable object and what are its advantages?
· An immutable object is an object and any object it references that does not change after construction. The object is, therefore, immutable for its lifetime. · Immutable classes are commonly used to represent strings, colors, and numeric values. Advantage: · They guarantee that their state cannot change after construction, they are inherently thread-safe.