java-stream

Java Streams-Cambia campo di un elemento

Ho cercato su Google per un po', ma non sono riuscito a trovare la risposta che sto cercando. Ho un stream di prodotti e o ... icare il valore del campo quantità? I stavo pensando di poter usare .peek(), ma non riuscivo a capire come ottenere questo.

Come peek() e allMatch () lavorano insieme in Java 8 Stream API

Ho trovato un quiz su Java 8 Stream API del metodo peek come di seguito Arrays.asList("Fred", "Jim", "Sheila") .stream ... Jim Sheila Il metodo peek() è un'operazione intermedia ed elabora ogni elemento nel Flusso. Qualcuno può spiegarmi questo.

Why do we need and as method parameters

There is a function: <R> Stream<R> map(Function<? super T, ? extends R> mapper); It performs operations ... fter all, we just pass the implementation with specific T(User) and R(String), where can we use subclasses and superclasses?

how do I copy a java 8 Stream?

Need a function that calculates the min and max from Stream public static <T> void findMinMax( Stream<? ... right away, because the passed parameter Stream<? extends T> stream is not only Integer maybe, how to fix this problem?

What is the difference between the map and flatMap methods in Java 8?

What is the difference between the methods Stream.map and Stream.flatMap apart from each other?

Character-by-character console input via Java 8 Stream

How can I convert console input System.in in a stream of characters. I tried this combination: new BufferedReader(new Input ... r(Character::isDigit) .map(Character::getNumericValue) .limit(3) .toArray();

A foreach loop versus an Iterable loop.foreach in Java 8: what's better?

Which of the following is the best practice in Java 8? Java 8: list.forEach(e -> e.operation); Java 7: for (E e : lis ... bdas, but are there any real benefits from using Iterator.foreach? Will the performance and readability of the code improve?

What are the differences between findFirst and findAny in Java 8?

I don't really understand the difference between findFirst() and findAny() in the Java Stream API. I thought that findFirst ... and Stream.of(...).findAny() Then they both return the first element of the stream. Why? Are they both doing the same task?

Modify the code using loops from java 8

The code replaces numbers with words. How can this be changed using loops from java 8? I tried it myself, but you can only pa ... } } catch (IOException e) { e.printStackTrace(); } } }

What does it mean: a sign in java? [duplicate]

This question has already been answered here: ... , in streams, sometimes in lambda expressions. What does it mean? What does List :: stream mean? P.S. And what is it called?

How to debug Java 8 streams in Intelij IDEA?

How to debug Java 8 streams in Intelij IDEA? All intermediate calls are lazy and are executed during a terminal operation, so ... e step other than the start and end. System.out. println arrange-somehow unprofessional, there are other ways out of the box?