title: Java: How can I println an error message when the comand line argument is not a valid integer?
body: <p>I made an application in Java that calculates the sum of all numbers up untill the input in the command line.</p>
  
  <p>But, if one would put in a double or string in the command line i need to display an error message that says only real numbers can be put in. </p>
  
  <p>How can i do this? I think it needs to be with exception or something? </p>
  
  <pre><code>public static void main(String[] args) {
   right here?
      int n    = Integer.parseInt(args[0]);
  </code></pre>
  
  <p>thanks!</p>