title: Draw array to canvas
body: <p>I'm trying to draw objects onto a canvas from an array, but the thing is, I have no clue how to? This must include the position and sizes of the shapes, and there will be more than one type of shape. The code I've got so far(It's inefficient/bad though)</p>
  
  <pre><code>public class MCanvas extends Canvas {
      private Object[] world = {};
  
      public void paint(Graphics g){  
          try{  
             // How to paint all the shapes from world here?
          } catch (NullPointerException e) {  
                System.out.println(e.toString());  
          }  
        } 
  
  }
  </code></pre>
  
  <p>Any ideas? Thanks.</p>