Skip to content

Fix ordenarDescendente() #116

Description

@Bruno-engcomp

public List ordenarDescendente() {
List numerosAscendente = new ArrayList<>(this.numerosList);
if (!numerosList.isEmpty()) {
numerosAscendente.sort(Collections.reverseOrder());
return numerosAscendente;
} else {
throw new RuntimeException("A lista está vazia!");
}
}
O nome da lista deveria ser numerosDescente, mas não afeta o entendimento, continua muito bem explicado

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions