Showing posts with label Java_8_Features. Show all posts
Showing posts with label Java_8_Features. Show all posts

Jun 26, 2022

Java Stream Intermediate and Terminal Operations

Java Stream API operations that returns a new Stream are called intermediate operations. Most of the times, these operations are lazy in nature, so they start producing new stream elements and send it to the next operation. 

Intermediate operations are never the final result producing operations. Commonly used intermediate operations are filter and map.

Jun 25, 2022

Lambda Expression

Lambda Expression

Lambda Expression are the way through which we can visualize functional programming in the java object oriented world. 

Objects are the base of java programming language and we can never have a function without an Object, that’s why Java language provide support for using lambda expressions only with functional interfaces.

Since there is only one abstract function in the functional interfaces, there is no confusion in applying the lambda expression to the method. 

Functional Interfaces in Java 8

Lambdas in Java 8

Java 8 brought a powerful new syntactic improvement in the form of lambda expressions. A lambda is an anonymous function that we can handle as a first-class language citizen. For instance, we can pass it to or return it from a method.

Before Java 8, we would usually create a class for every case where we needed to encapsulate a single piece of functionality. This implied a lot of unnecessary boilerplate code to define something that served as a primitive function representation.

Jun 24, 2022

Java_8_Features - ALL

 

 

You may also like

Kubernetes Microservices
Python AI/ML
Spring Framework Spring Boot
Core Java Java Coding Question
Maven AWS