Discriminating general String objects from meaningful numerical values is a question of parsing.
Java's got a method called Integer.parseInt(""). When it fails, it throws a NumberFormatException.
Thus we know the argument wasn't a valid numerical value, and gotta be treated as a String:
Answers
Discriminating general String objects from meaningful numerical values is a question of parsing.
Java's got a method called Integer.parseInt(""). When it fails, it
throws
a NumberFormatException.Thus we know the argument wasn't a valid numerical value, and gotta be treated as a String:
http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#parseInt-java.lang.String-
Check out this example I've come up w/: <):)
Thanks.