objects created using an array, not able to call it's method!! Why?
<p>I created 2 source code files, <strong>Shirt.java</strong> and <strong>ShirtTestArray.java</strong></p>

<p>The problem I am facing is that whenever I try to access the displayShirtInformation() method, I'm not able to do it.. and get an error <strong>class,interface,or enum expected</strong></p>

<p>The 2 source files are given below--</p>

<p><strong>Shirt.java--</strong></p>

<pre><code>public class Shirt {

  public int shirtID = 0; // Default ID for the shirt
  public String description = "-description required-"; // default

  // The color codes are R=Red, B=Blue, G=Green, U=Unset
  public char colorCode = 'U';
  public double price = 0.0; // Default price for all shirts
  public int quantityInStock = 0; // Default quantity for all shirts

  public Shirt() {
  }

  public Shirt(int ID, String d, char c, double p, int q) {
    shirtID = ID;
    description = d;
    colorCode = c;
    price = p;
    quantityInStock = q;
  }

  // This method displays the values for an item
  public void displayShirtInformation() {

    System.out.println("Shirt ID: " + shirtID);
    System.out.println("Shirt description:" + description);
    System.out.println("Color Code: " + colorCode);
    System.out.println("Shirt price: " + price);
    System.out.println("Quantity in stock: " + quantityInStock);

  } // end of display method
} // end of class
</code></pre>

<p><strong>ShirtTestArray.java --</strong></p>

<pre><code>public void  ShirtTestArray{
  public static void main(String [] args) {
    Shirt [] shirtArray={new Shirt (1,"blue",'b',76.67,4),new Shirt(2,"green",'g',98.79,1),
    new Shirt(3,"green",'g',34.78,90)};

    shirtArray[0].displayShirtInformation();
    shirtArray[1].displayShirtInformation();
    shirtArray[2].displayShirtInformation();

  }
}
</code></pre>
