filter() Method Stream filter(Predicate
Category: Java 8
Java 8 got a brand new API called streams. it makes every developer’s life easy. Stream APIs are used to process the group of data. mostly streams are applied on collection objects but we can use stream with any group…
Consumer Interface is another Built-In Functional Interface of java.util.function package of Java 8. The consumer interface consumes the object and doesn’t return any object. it has only one abstract method called accept(). Along with this, it has one more default…
Supplier Interface is another Built-In Functional Interface of java.util.function package of Java 8. Supplier Interface used for assignment purposes. It has only one abstract method and doesn’t have any default or static method. Below is the get() method signature. It…
Predicate Interface is another Built-In Functional Interface of java.util.function package of Java 8. Predicate Interface can be used to evaluate the expression which returns the boolean result like true or false of the given expression. Example: Predicate logic = X…
Functional Interface was added in Java 8. Functional Interface is like a normal interface with only one abstract method. Remember, a Functional interface can have a default method but should have only one abstract method which is unimplemented. Also, @FunctionalInterface…
Lambda Expressions were added in Java 8. In Simple words, We can think of lambda expression as a function without a name and with or without a parameter. public void MyFunction(int param1, int param2){ } The Above MyFunction() Method can…