Questions tagged as 'java-stream'

2
answers

Differences between .map and .flatMap?

I am working with Streams (Java 8) and when I use the .stream() method it is not clear to me the difference between .map and .flatMap . What are the differences between these methods?     
asked by 04.04.2016 / 13:41
2
answers

Remove elements from an array that are already in another array

Dear, I have an initial student array and an array of new students. How can I do to obtain an array of new students that are not in the initial student array? This using java lambdas. UPDATE List listaFinal = new ArrayList(); for (Alum...
asked by 14.11.2017 / 23:21
0
answers

Leak of database connections with ThreadLocal when inspecting a Hibernate entity inside a ParallelStream

The problem is that when I inspect the attributes of an entity (Hibernate) inside a ParallelStream, sessions are created to the database in each Thread created by the Stream. These sessions can not be closed since I can not access the session. c...
asked by 02.03.2017 / 22:48
2
answers

Reverse string using Streams in Java 8

I would like to reverse the order of a text string using Java Java API Java 8. This is what I have tried, but it does not make the investment. import java.util.Comparator; import java.util.stream.Collectors; import java.util.stream.Stream;...
asked by 20.06.2018 / 03:10
1
answer

flows streams with * .dat files

I'm making an application with swing and I need to link data that I enter for that application to a * .dat file. The fact is that I have three packages and each package with its * .java: Package 1: Class Vehicles with their attributes and met...
asked by 07.03.2018 / 20:18