Using streams concurrently with the parallel method is a good idea to optimize performance. However, it’s not always the case that we can use the parallel method, for example, when we depend on the order of logic execution.
When we are working with Threads, it’s important to know when to use a daemon or a non-daemon Thread.
Do you know if the main Thread is a daemon or not? And do you know what a daemon Thread is?
That’s what you will find out by trying out the following Java Challenge!
Functional programming is a very powerful paradigm that makes code more concise and easier to understand.
In Java, the “Function” functional interface can be used as a first-class citizen function, meaning that we can pass a function to a method and declare it as a variable, giving the developer a lot of power.
And now it’s time for you now to test your abilities with lambdas and functional interfaces!
To manipulate data from a collection by using a Java stream is handy and cleaner than the alternatives.
When you learn how to use streams, your Java code will be much better, and knowing how to limit and filter data with streams is crucial for you to do something useful with streams in Java.
Understanding the mechanics of the functional interface Predicate of a Stream is crucial if you want to create something meaningful with streams.
In this challenge, we will explore important key methods when we work with a stream so that it becomes clear for you what they do.
Without further ado, let’s go to the Java Challenge!
There are many concepts involved in Java Challenges! In essence, we will continue exploring lambdas and the Function interface the most.
However, we also have static methods introduced in Java 8 and the private method in interfaces introduced in Java 9. In the invocation of the interface methods, we are using anonymous inner classes too!
Are you ready for the next Java Challenge? Less introduction, more action, try out this Java Challenge, and master Java concepts by having fun!
Since Java 9, it’s possible to use Optional with a stream when 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? It’s time to improve your Java skills with this Soprano ofNullable stream Challenge…
Do you know what the differences are between method references and lambdas?
In this Java Challenge, we will explore how lambdas and method references behave so that you can really understand how they work!
Now that you know the main context, it’s time for the Java Challenge!
It’s time to improve your Java skills with this Method Reference VS Lambda Challenge.
Polymorphism, the ability of an object to take on multiple forms, is one of the most important Java concepts.
We might not even be aware we’re using it all the time but when we instantiate an ArrayList and assign it to a variable of the List type, we are using polymorphism.
It’s a powerful concept because it helps us to decouple responsibilities, therefore, making code more flexible and easier to maintain.
The Completable Future feature is powerful for better performance when running asynchronous methods.
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 the limitations of the Future interface, we have the CompletableFuture API with methods that will help us to build reliable high-performant software.
Now that we had the intro about CompletableFuture, let’s go to the Java Challenge!
It’s possible to use type erasure generics in a method with Java. To know how to use generics is important because then you are able to create highly reusable code.
In the following Java Challenge, you will see the generic type that will be erased by the compiler and then will be replaced by the type we defined at runtime.
Note also that we are using the extends keyword which means that the generic type will extend the other type.
Without further ado, it’s time to solve the Java Challenge quiz!
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.
Therefore, if you master the concept of object references, equals and hashcode, and Maps, you can apply this in other programming languages and master them far more easily.