What is an immutable object?

What is an immutable object?

Approach: Define object that cannot change after creation.

An object whose state cannot be modified after it is created. Examples include String in Java.

Follow-up: Why are immutable objects useful in multi-threaded environments?

Key concepts: thread safety, final fields.