title: How do I get a random number with a negative number in range?
body: <p>Consider the following code:</p>
  <pre><code>int rand = new Random().nextInt((30 - 20) + 1) + 20
  </code></pre>
  <p>It will return a random number between 30 and 20. However, I need its range to include negative numbers. How would I include negative numbers in the generation?</p>
  <p>I have tried using math that would be negative, but that resulted in an error. Simply subtracting or adding the negative numbers would not yield the desired value.</p>
  <hr/>
  <p>Sorry, I am only half awake. The correct code is <code>int rand = new Random().nextInt((30 - 20) + 1) + 20;</code>.</p>