-
Notifications
You must be signed in to change notification settings - Fork 547
Open
Description
Oi, Camila!
No desafio 4, consegui selecionar os números ímpares, porém quando fui removê-los da lista, não deu certo (tentei remover utilizando o método removeAll). Qual o procedimento para a remoção?
Obrigado!
Segue meu código:
public class RemoverImpares {
public static void main(String[] args) {
List<Integer> numeros = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 5, 4, 3);
List<Integer> numerosImpares = numeros.stream().filter(n -> n % 2 != 0).toList();
}
}
renatolopes1984
Metadata
Metadata
Assignees
Labels
No labels