Access object.variable in an array of objects
<p>I need help with this piece of code.</p>

<pre><code>public class ParkingLot {

static int MAX = 5;
static Car[] Slot = new Car[MAX];

public static void main(String[] args) {


    Slot[0] = new Car("1234", "White");
    Slot[1] = new Car("5678", "Black");

}

public static void Allot() {
    for (int i = 0; i &lt;= Slot.length; i++) {
        System.out.println(Slot.getNo);

    }
}
</code></pre>

<p>I am storing a <code>Car</code> Object in <code>Slot</code>. I wish to print/access the <code>No</code> and <code>Colour</code> of the car stored in slot. How do I go about doing that?</p>
