title: Java while loop and random method
body: <p>I'm currently learning Java and learning while loop right now. How could I used the random() method to generate random negative number? Also, how do I make the program print out value that fall only in a certain range? For example Let say Java choose 10 random numbers, how could I make it so it only display number between 0.6 and 0.8?</p>
  
  <pre><code> double randomNumber;
      int counter = 0;
  
      while(counter &lt;= 99)
      {
          randomNumber = Math.random();
          System.out.println(randomNumber);
           counter++;
  </code></pre>