Understanding the mechanics of the functional interface Predicate of a Stream is crucial if you want to create something meaningful with streams. On this challenge, we will explore important key methods when we work with a stream so that it becomes...
Using a tokenizer with regex is a useful concept to know that is existent in programming languages. Often enough we need to manipulate Strings in a more sophisticated way, sometimes we need to validate, or we just need to break them down. Therefore...
To manipulate data from a collection by using a stream is handy and cleaner. To learn how to use streams will make your Java code much better. To know how to limit to filter data with streams is crucial for you to do something useful with a stream...
Since Java 9, it’s possible to use Optional with a stream in case we need to manipulate values from a List. In this Java Challenge, we will explore the use of a stream in an Optional! Are you ready to solve this Java Challenge? If you want to...
In Java 12 the new switch case with lambda preview feature was introduced which reduces the boilerplate code. In Java 14, this feature became standard. Now instead of using the break keyword in every case statement, we can simply use a lambda...
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...
Even still there are plans of removing Serialization from Java completely, it’s still relevant to know it since many systems and projects are using it. If you are curious to know more about the subject, you can check the following article: JDK...
Functional Programming is a very powerful paradigm that in Java, makes code more concise and easier to understand. The Function functional interface can be used as a first-class citizen function in Java, this means that we can pass a function to a...
The Optional concept is present in many other programming languages. The main goal of the Optional class is to avoid NullPointerException. It’s much easier to deal with null values when we use the concepts of an Optional. In this challenge, we...
The Completable Future feature is powerful to run asynchronous methods for better performance. In Java 5 there is the Future interface, however, the Future interface doesn’t have many methods that would help us to create robust code. To solve...