• Top 10 Java Language Features

    Let’s explore ten Java programming features used frequently by developers in their day-to-day programming jobs.

    Read more
  • Playing practically with Stream API

    Let’s learn java stream API with a few practical examples

    Read more
  • Parallel Streams Java Code Quiz

    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.

    Read more
  • Neo Stream Search Java Challenge

    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!

    Read more
  • Soprano ofNullable stream Java Challenge

    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…

    Read more
  • Asynchronous CompletableFuture San Francisco Adventure Java Challenge

    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!

    Read more
  • Teeing: Hidden Gem in the Java API

    Last week, I described a use-case for a custom Stream Collector. I received a intriguing comment on Twitter.

    So I decided to investigate what is the teeing() method about, which returns a Collector that is a composite of two downstream collectors.

    Every element passed to the resulting collector is processed by both downstream collectors, then their results are merged using the specified merge function into the final result.

    Read more

    This week, I learned about a nifty “new” feature of Optional that I want to share in this post. It’s available since Java 9, so its novelty is relative.

    We start with a sequence to compute the total price of an order, for which it is nowadays more adequate to use streams instead of iterations.

    Optional makes the code less readable! I believe that readability should trump code style every single time.

    Fortunately, Optional offers a stream() method (since Java 9). It allows to simplify the functional pipeline. Functional code doesn’t necessarily mean readable code. With the last changes, I believe it’s both.

    Read more

Subscribe to foojay updates:
Copied to the clipboard