I need to check whether the String is an Integer. And I found such solution:
private boolean isInteger(String str) {
try {
Integer.parseInt(str);
return true;
} catch (NumberFormatException e) {
return false;
}
}
Is there a more beautiful and proper way to do this without try/catch clause?