mutable state

Data that can change after it is created, such as a field that is reassigned or a list that is added to.

In more detail

Mutable state is where most bugs involving ownership and concurrency live. When two threads change the same state without coordination, the result depends on timing. Prefer immutable values, give each piece of mutable state one clear owner, and keep singletons stateless.

Related terms

Taught in

References