Java Stream

Java Stream

Java Stream API has been introduced in Java 8 which majorly focuses on providing various method for operation on Source.  It operates around Source as wrapper making bulk operation fast and in few lines.

Stream bring functional programming to Java and heavily uses lambda expression for its implementation. ParallelStream can be used for multi-threaded operations.

Stream operations can be classified into two sets

  1. Intermediate Operations
  2. Terminal Operations

Read More Read More

How to avoid null pointer

How to avoid null pointer

The concept of Null Reference is sometimes referred to as “The Billion Dollar Mistake”.  In keeping with modern best practices, you want to eliminate null values from your code.

General rules about null and Option

We begin with the following general rules regarding the use of null values in Scala code:

Read More Read More

Intro to stream APIs in Java

Intro to stream APIs in Java

Stream API was introduced in Java 8. It provided a declarative programming approach to iterate and perform operations over a collection. Until Java 7, for and for each were the only options available, which was an imperative programming approach. In this article I will introduce you to the Stream API and how it provides an abstraction over the common operations performed over a collection.

Read More Read More