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
How to create a base64 decoder in java8?
What is a classloader in java?
What is an object in java and how is it created?
What is parsing in java?
Is minecraft 1.15 out?
What do you mean by an interface in java?
What is a constructor overloading in java?
Explain public static void main(string args[]) in java.
How to sort array in descending order in java?
Realized?
What is the difference between equals() and == in java?
explain different ways of using thread? : Java thread
What is the difference between break and continue statements?
What is java string pool?
Differentiate between static and non-static methods in java.