The following method checks whether a string is a numeric string:
public static boolean isNumeric(String token) {
try {
Double.parseDouble(token);
return true;
}
catch (java.lang.NumberFormatException ex) {
return false;
}
}
Is it correct? Rewrite it without using exceptions.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.