title: Generating 10 random numbers in a for loop between 1 and 50 in java
body: <p>I need to create a program in Java which generates 10 random numbers between 1 to 50 and output them using a <code>for</code> loop. I have figured out how to generate the random numbers, but cant figure out how to do it using a for loop. Please help!</p>
  
  <pre><code>import java.util.Random;
  class RandomNumbers
  {
  public static void main (String [] args)
  {
  int random = (int)(Math.random()* (50 + 1));
  System.out.println (random);
  }
  }
  </code></pre>