Fórum Validar um numero inteiro. #567485
09/04/2009
0
Lawrence Silva
Curtir tópico
+ 0Posts
09/04/2009
Juan Damasceno
try {
int i = Integer.parse(numero);
} catch (NumberFormatException e) {
// Se entrar aqui o numero é invalido.
}
Gostei + 0
09/04/2009
Lawrence Silva
Gostei + 0
09/04/2009
Jamesond
public boolean isInt(String v) {
try {
Integer.parseInt(v);
return true;
} catch (Exception e) {
return false;
}
}
Gostei + 0
09/04/2009
Lawrence Silva
Gostei + 0