I have the following method:
public void agregarNumero()
{
String numero;
boolean agregado=false;
numero = bokNumero.getText();
int auxNumero=Integer.parseInt(numero);
agregado = numeroHardy_Ramanujan.Recursivo_esHardyRamanujan(auxNumero, 1, 1);
if (agregado)
{
Alert mensaje;
mensaje = new Alert (Alert.AlertType.INFORMATION);
mensaje.setContentText("El numero es Hardy_Ramanujan");
mensaje.showAndWait();
}
else
{
Alert mensaje = new Alert (Alert.AlertType.INFORMATION);
mensaje.setContentText("NO ES ");
mensaje.showAndWait();
}
}
When capturing the String and sending it to the method that returns a boolean, errors pop up telling me that the error is on the line where I cast the integer, what could it be? ...
You can add a validation code in case the value of
numero
is not valid: