How to solve java.lang.NullPointerException
<p>I am getting the <code>java.lang.NullPointerException</code> on the <code>cars.add(car);</code> line and I am really unsure how to solve it, I have read some of the other threads relating to this error, but the answer still seems to have eluded me. </p>

<pre><code>public class RentalCompany {

    private ArrayList&lt;Car&gt; cars;
    private String description;
    private int carDownPayment;
    private int rate;
    private int carNumber;

    public void addCar(String descriptionOfTheCar, int downPayment,
        int dailyRate) {
        Car car = new Car(descriptionOfTheCar, downPayment, dailyRate);
        cars.add(car);
    }
}
</code></pre>

<p>If anyone can offer any advice I would be very much obliged, thanks in advance. </p>
