-
Notifications
You must be signed in to change notification settings - Fork 869
Open
Description
Percebe no seu codigo que quando você esta dentro do laço o seu teste e se numero e >= (Maior ou iguala) e nao > (Maior) tem um motivo para adicionar o = (Igual) ?
public int encontrarMaiorNumero() {
int maiorNumero = Integer.MIN_VALUE;
if (!numeros.isEmpty()) {
for (Integer numero : numeros) {
if (numero >= maiorNumero) {
maiorNumero = numero;
}
}
return maiorNumero;
} else {
throw new RuntimeException("A lista está vazia!");
}
}
Metadata
Metadata
Assignees
Labels
No labels