title: Throw an exception when too many/few arguments are passed to main
body: <p>I'm writing a dice rolling programme which has two parameters passed to the main, how many sides the dice has and the amount of times you want to throw it. I wanted to throw an exception if less than or more than two parameters are passed. How would I go about doing this? </p>
  
  <p>I found <a href="http://sswap.info/docs/Impl/Java-API/info/sswap/ontologies/exec/api/TooManyArgumentsException.html" rel="nofollow">this</a>.
  But I'm not really sure how to use it? Surely I must somehow specify the amount of arguments that are expected before that exception can be thrown?</p>