title: Adding objects to ArrayList from another class
body: <p>I'm very new to programming and currently trying to write a car showroom application.  I've got a vehicle class, showroom class and I'm trying to use a showroom driver for the input.  </p>
  
  <p>I'm having problems adding vehicle objects to my arraylist.  Could someone point me in the correct direction.</p>
  
  <p>My code:</p>
  
  <pre><code>public class Vehicle {
  
      private String manufacturer;
      private String model;
      private String custName;
      private String vin;
      private String dateMan;
      private String dateSold;
      private Boolean sold;
      private char tax;
      private double cost;
  
      public Vehicle(String a, String b, String c, String d) {
          manufacturer = a;
          model = b;
          vin = c;
          dateMan = d;
      }
  
      public String toString() {
          String s = "Manufacturer: " + manufacturer + "  Model: "
                  + model + "  vin: " + vin + "Date Manufactured:" + dateMan
                  + "Cost: " + cost;
          return s;
      }
  
      public void buyVehicle(String a, String b) {  //buy method for the vehicle
          a = dateSold;
          b = custName;
          sold = true;
      }
  
      public String getManufacturer() {
          return manufacturer;
      }
  
      public String getModel() {
          return model;
      }
  
      public String getCustName() {
          return custName;
      }
  
      public String getVin() {
          return vin;
      }
  
      public String getDateMan() {
          return dateMan;
      }
  
      public String getDateSold() {
          return dateSold;
      }
  
      public Boolean getSold() {
          return sold;
      }
  
      public char getTax() {
          return tax;
      }
  
      public double getCost() {
          return cost;
      }
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>import java.util.ArrayList;
  
  public class Showroom {
  
      private ArrayList&lt;Showroom&gt; theVehicles;
  
      public Showroom() {
          theVehicles = new ArrayList&lt;Showroom&gt;();
      }
  
      public boolean addVehicle(Showroom newVehicle) {
          theVehicles.add(newVehicle);
          return true;
      }
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>import java.util.*;
  
  public class ShowroomDriver {
  
      public static void main(String[] args) {
          Vehicle v1 = new Vehicle("renault", "clio", "12", "290890");
          Showroom.addVehicle(v1);
      }
  }
  </code></pre>
  
  <p>Basically, I'm confused to how I add vehicle objects to the arraylist within the showroom class. If anyone could point me in the right direction I would really appreciate it.</p>
  
  <p>Thanks in advance.</p>