Exceções Checáveis vs Não Checáveis
private static int dividir(int i, int j) {
if (j == 0) {
throw new IllegalArgumentException("Não é possivel realizar divisão por zero.");
}
return i / j;
}Atualizado
private static int dividir(int i, int j) {
if (j == 0) {
throw new IllegalArgumentException("Não é possivel realizar divisão por zero.");
}
return i / j;
}Atualizado