This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Integer TryParseInt(String someText) { | |
try { | |
return Integer.parseInt(someText); | |
} catch (NumberFormatException ex) { | |
return null; | |
} | |
} |
1 comment:
You should be careful about saying hashCode() returns a unique code in general. There should be very rare occurrences of it ever getting a repeated code for different values, but there are collisions none-the-less in some objects of greater than an int's size that have to accounted for.
Post a Comment