flâneur — a map of the web's best reading

An Introduction to Synchronized Java Collections | Baeldung

baeldung.com · 1,672 words · saved by 1 readers

The collections framework is a key component of Java. It provides an extensive number of interfaces and implementations, which allows us to create and manipulate different types of collections in a straightforward manner. Although using plain unsynchronized collections is simple overall, it can also become a daunting and error-prone process when working in multi-threaded environments (a.k.a. concurrent programming). Hence, the Java platform provides strong support for this scenario through different synchronization wrappers implemented within the Collections class. These wrappers make it easy to create synchronized views of the supplied collections by means of several static factory methods. In this tutorial, we’ll take a deep dive into these static synchronization wrappers. Also, we’ll highlight the difference between synchronized collections and concurrent collections. The first synchronization wrapper that we’ll cover in this round-up is the synchronizedCollection() method. As the n

eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud) Let's get started with a Microservice Architecture with Spring Cloud: >> Join Pro and download the eBook eBook – Mockito – NPI EA (tag = Mockito) Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code. Get started with mocking and improve your application tests using our Mockito guide : Download the eBook eBook – Java Concurrency – NPI EA (cat=Java Concurrency) Handling concurrency in an application can be a tricky pr

Explore this link on the map →

related reading