title: Good way to encapsulate Integer.parseInt()
body: <p>I have a project in which we often use <code>Integer.parseInt()</code> to convert a String to an int. When something goes wrong (for example, the <code>String</code> is not a number but the letter <code>a</code>, or whatever) this method will throw an exception. However, if I have to handle exceptions in my code everywhere, this starts to look very ugly very quickly. I would like to put this in a method, however, I have no clue how to return a clean value in order to show that the conversion went wrong. </p>
  
  <p>In C++ I could have created a method that accepted a pointer to an int and let the method itself return true or false. However, as far as I know, this is not possible in Java. I could also create an object that contains a true/false variable and the converted value, but this does not seem ideal either. The same thing goes for a global value, and this might give me some trouble with multithreading. </p>
  
  <p>So is there a clean way to do this? </p>