"does using only immutable data types make a java program thread safe?" Code Answer

1

thread safety is about protecting shared data and immutable objects are protected as they are read only. well apart from when you create them but creating a object is thread safe.

it's worth saying that designing a large application that only uses immutable objects to achieve thread safety would be difficult.

it's a complicated subject and i would recommend you reading java concurrency in practice which is a very good place to start.

By adsamcik on September 15 2022

Answers related to “does using only immutable data types make a java program thread safe?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.