title: NullPointerException in generating random numbers
body: <p>I get a NullPointerException at line 14 the one that says: </p>
  
  <pre><code>points[i].x = new Random().nextInt(30);
  </code></pre>
  
  <p>My full Code:</p>
  
  <pre><code>import java.util.Random;
  
  public class RandomPoints {
      public class Point {
           public int x;
           public int y;
      }
  
      public static void main(String[] args) {
          Point[] points = new Point[100];
          for(int i = 0; i &lt; points.length; i++) {
              points[i].x = new Random().nextInt(30);
              points[i].y = new Random().nextInt(30);
              System.out.println(points[i].x + " " + points[i].y);
          }           
      }
  }
  </code></pre>