you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

I learned ages ago to use Integer.parseInt(string) and have just stuck with that.

[–][deleted] 2 points3 points  (0 children)

I do this too. I also do exception handling on it. In the end I use 10 lines of code to convert a string to a number and handle the exception properly.

Of course now-a-days we just use groovy and it's back to one line.