Explain the difference between intermediate and terminal operations in java8?
Answer / 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 |
What classes of exceptions may be thrown by a throw statement?
What is private public protected in java?
What data structures are used to perform recursion?
1 Answers Akamai Technologies,
What is predicate in java?
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
What is the name of the java compiler?
What are parent methods and how can you call them?
What are the new features in java 8?
Explain illegalmonitorstateexception and when it will be thrown?
What are alternatives to java serialization?
Is null keyword in java?
What is a pattern what is an anti pattern?