title: How to print a void method from main method
body: <p>Okay so I have three class</p>
  
  <pre><code>abstract class Shape  
  {  
  int width, height;  
  String color;
  
  public void draw()    
  {      
  }
      } // end Shape class
  </code></pre>
  
  <p>``</p>
  
  <pre><code>class Rectangle extends Shape
     {
  Rectangle(int w, int h, String color)
  {
      width = w;
      height = h;
      this.color = new String(color);
  }
  
  public void draw()
  {
      System.out.println("I am a " + color + " Rectangle " + width + " wide and " + height + " high.");
  }
     }// end Rectangle class
  </code></pre>
  
  <p>``</p>
  
  <pre><code> class Circle extends Shape
     {
    Circle (int r, String color)
     {
      width = 2*r;
      height = 2*r;
      this.color = new String(color);   
  }
  public void draw()
  {
      System.out.println("I am a " + color + " Circle with radius " + width + ".");
  }
      } // end Circle class
  </code></pre>
  
  <p>`` What I am trying to do is create a new class to produce the following outputs: 
  I am a blue Rectangle 20 wide and 10 high.
  I am a red Circle with radius 30.
  I am a green Rectangle 25 wide and 25 high 
  But I am having a problem calling the method draw();  </p>
  
  <pre><code> This is the main class:
   public class Caller
    {
     public static void main(String args[]) 
      {
  Caller call= new Caller();
  Shape[] myShape = new Shape[3];
  
     myShape[0] = new Rectangle(20,10,"blue");
     myShape[1] = new Circle(30, "red");
     myShape[2] = new Rectangle(25,25, "green");
     for (int i=0; i &lt; 3; i++)
       {
  System.out.println();
       }
      call.draw(Rectangle);
      call.draw(Circle);
     } 
     }
  </code></pre>