Java 8 has introduced a new abstraction called Stream, letting us processing data in a declarative way. Furthermore, streams can leverage multi-core architectures without you having to write a single line of multithread code.
Deep cloning of object has always been something that every Java developers work on so frequently. There are a lot of articles talking about a different way to clone objects deeply and obviously, the preferred method is to use Copy Constructors since it overcomes the design issues of Object.clone() and provides better control over object construction.
This has been one of the popular programming tasks for Java developer, particularly focusing on text processing.
This has been one of the most frequently asked questions in Java interviews. With streams introduced after Java 8, this can be achieved in an elegant and functional way.
Since Java 8, a lot of boilerplate code can be replaced with lambda expressions in our codebase. I really want to put out an article about Streams in Java, but since that carries real value only if we combine them with lambda expressions, I want to write about some ideas about playing around with lambda expressions first.
Java 8 introduced the
Optionalclass to make handling of nulls less error-prone. For example, the following program to pick the lucky name has a null check as: