title: Libgdx Array of Rectangles
body: <p>I am doing collision detection, and I need an array of rectangles to loop through. It is not working and instead gives me a null pointer exception.<br>
  This is my code:</p>
  
  <pre><code>Array&lt;Rectangle&gt; rects = new Array();
  Rectangle rect = new Rectangle();
  rects.add(rect);
  </code></pre>