Tag: map

concurrent map

Concurrent Map Challenge

This Java Challenge will introduce the ConcurrentHashMap class that is useful to use in a multi-thread environment. The ConrrentHashMap can also be used to delete an element inside a for loop for example. The ConcurrentHashMap will synchronize...

map collection factory

Map Collection Factory Java Challenge

In Java 9 we can use Collection Factory with List, Set, or Map. This makes code more concise and easier to read because we don’t need to add element per element in the Map. Therefore, it’s time to try this fun Java Challenge! Are you...

parallel stream

Parallel Streams Java Challenge

Using streams concurrently with the parallel method is a good idea to optimize performance. It’s not always that we can use the parallel method, for example, when we depend on the order of logic execution. However, when we can process the...

map equals hashcode

Map equals hashcode Challenge

Understanding deeply how to use a Map, equals, and hashcode in Java will be a massive help for you to create high-quality code. The Map and object reference concepts are not only present in the Java language but in almost all programming languages...

stream_map_flatMap

stream, map, flatMap JC #43

Understand how to manipulate a stream within a Collection from an object with the map and flatMap methods. By using a map and flatMap it’s possible to have a flexible and maintainable code. Get the code of the Java Challengers and run your own...