About 5,280,000 results
Open links in new tab
  1. java - What is InputStream & Output Stream? Why and when do we …

    5 Java stream is a flow of data from a source into a destination. The source or destination can be a disk, memory, socket, or other programs. The data can be bytes, characters, or objects. The same applies …

  2. Java 8 streams to find the duplicate elements - Stack Overflow

    Dec 28, 2014 · Java 8 streams to find the duplicate elements Asked 10 years, 11 months ago Modified 8 months ago Viewed 278k times

  3. How to sum a list of integers with java streams? - Stack Overflow

    May 8, 2015 · From the docs Reduction operations A reduction operation (also called a fold) takes a sequence of input elements and combines them into a single summary result by repeated application …

  4. list - How can I reverse a Java 8 stream and generate a decrementing ...

    Reversing a Stream prior to Java version 21 without using a customized collection type is more verbose, typically requiring an extra line to reverse the resulting list.

  5. java - Using streams to convert a list of objects into a string ...

    I'm going to use the streams api to convert a stream of integers into a single string. The problem with some of the provided answers is that they produce a O (n^2) runtime because of String building.

  6. Java 8: How do I work with exception throwing methods in streams?

    Java 8: How do I work with exception throwing methods in streams? Asked 11 years, 7 months ago Modified 7 years, 1 month ago Viewed 307k times

  7. java - Stream and lazy evaluation - Stack Overflow

    Streams are lazy because intermediate operations are not evaluated unless terminal operation is invoked. Each intermediate operation creates a new stream, stores the provided operation/function …

  8. java - When should I use streams? - Stack Overflow

    Mar 1, 2017 · 14 The goal of streams in Java is to simplify the complexity of writing parallel code. It's inspired by functional programming. The serial stream is just to make the code cleaner. If we want …

  9. Ignore duplicates when producing map using streams

    Aug 31, 2015 · Map<String, String> phoneBook = people.stream() .collect(toMap(Person::getName, Person::getAddress)); I get java.lang.IllegalStateException: Duplicate key when a duplicated element …

  10. Can I duplicate a Stream in Java 8? - Stack Overflow

    Jun 29, 2014 · The Java implementation of the Stream has a great impact on the solution's shape. First impact is related to what happens when data-elements flow through a stream (aka pipe): to actually …