Что быстрее: Set или List? [закрыто]JAVA

Программисты JAVA общаются здесь
Anonymous
Что быстрее: Set или List? [закрыто]

Сообщение Anonymous »


In my current situation I'm using a Set to not have any duplicates, but was wondering what is faster, Set or List?

Set sentEmails = drawingParticipants.stream() .map(participant -> participant.getParticipant().getEmail()) .collect(Collectors.toSet()); List sentEmails = drawingParticipants.stream() .map(participant -> participant.getParticipant().getEmail()) .toList(); Which should I use and why?


Источник: https://stackoverflow.com/questions/781 ... liststring

Вернуться в «JAVA»