Suppose that you want to make number primitives from strings. You could do
Integer.parseInt ( someString ) - easy. But sometimes the parameter might be null. What happens than? An exception, and from experience I know that it's
NumberFormatException.
What if you want a double rather than an int?
Double.parseDouble ( someString ) is good, but can you guess what it does with null? Here's a test class and its output.
( Read more...Collapse )Anyone know a good reason for this?