title: Generating a Random Number between 1 and 10 Java
body: <p>I want to generate a number between 1 and 10 in Java.</p>
  
  <p>Here is what I tried:</p>
  
  <pre><code>Random rn = new Random();
  int answer = rn.nextInt(10) + 1;
  </code></pre>
  
  <p>Is there a way to tell what to put in the parenthesis <code>()</code> when calling the nextInt method and what to add? </p>