JAVA 8 INTERVIEW QUESTION ANSWER | FIND EVEN NUMBERS USING STREAM AND LAMBDA FUNCTIONS |InterviewDOT
Channel: Interview DOT
Date: 2021-05-01

#JAVA8 #JAVA8INTERVIEWQUESTIONS #JAVA8INTERVIEW #JAVA8PROGRAMMINGINTERVIEW #JAVA8PROGRAMMINGTUTORIAL
#JAVA8CODINGINTERVIEW
Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications.

JAVA 8 INTERVIEW QUESTION ANSWER | FIND EVEN NUMBERS USING STREAM AND LAMBDA FUNCTIONS |InterviewDOT

PLEASE SUBSCRIBE TO INTERVIEWDOT CHANNEL FOR LATEST SOFTWARE UPDATES THANKS FOR YOUR SUPPORT 

What are the functional interfaces in Java?
The term Java functional interface was introduced in Java 8. A functional interface in Java is an interface that contains only a single abstract (unimplemented) method. A functional interface can contain default and static methods which do have an implementation, in addition to the single unimplemented method.


What is Stream?
Stream represents a sequence of objects from a source, which supports aggregate operations. Following are the characteristics of a Stream −

Sequence of elements − A stream provides a set of elements of specific type in a sequential manner. A stream gets/computes elements on demand. It never stores the elements.

Source − Stream takes Collections, Arrays, or I/O resources as input source.

Aggregate operations − Stream supports aggregate operations like filter, map, limit, reduce, find, match, and so on.

Pipelining − Most of the stream operations return stream itself so that their result can be pipelined. These operations are called intermediate operations and their function is to take input, process them, and return output to the target. collect() method is a terminal operation which is normally present at the end of the pipelining operation to mark the end of the stream.

Automatic iterations − Stream operations do the iterations internally over the source elements provided, in contrast to Collections where explicit iteration is required.