adspace


Explain the difference between intermediate and terminal operations in java8?

Answer Posted / Shiv Shankar

Intermediate Operations are lazy in Java 8 Stream API, meaning they produce a new stream without consuming any elements from the source stream. They can be further chained with other operations to form complex pipelines. Terminal Operations are greedy; they consume all elements of the stream and return a result or no result (void). Examples of intermediate operations include filter(), map(), limit(), distinct(); while examples of terminal operations include count(), forEach(), reduce(), collect().

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a base64 decoder in java8?

1143


What is a classloader in java?

1092


What is an object in java and how is it created?

1144


What is parsing in java?

1046


Is minecraft 1.15 out?

1047


What do you mean by an interface in java?

1105


What is a constructor overloading in java?

1129


Explain public static void main(string args[]) in java.

1081


How to sort array in descending order in java?

999


Realized?

2268


What is the difference between equals() and == in java?

1044


explain different ways of using thread? : Java thread

1087


What is the difference between break and continue statements?

1131


What is java string pool?

1087


Differentiate between static and non-static methods in java.

1131