title: How do I update a users input in an arraylist?
body: <p>So I'm making a program for a car dealership as my final project for my class. At this time I'd say I'm about 75% done, but I am having trouble figuring out how to update the users input in an array list. So each array list slot contains the year, make, model, color, and mileage of a car. I can add a new car, I can remove a car, and I can quit my program. I have tried many things, I've read many papers, blogs, forums, and my book for class, but its always updating with the programmers input.</p>
  
  <pre><code>package carDealer;
  
  import java.util.ArrayList;
  import java.util.Scanner;
  
  public class VehicleInformation {
  
  public static void main(String [] args) {
  
      Scanner scnr = new Scanner(System.in);
      ArrayList&lt;VehicleInventory&gt; car = new ArrayList&lt;VehicleInventory&gt;();
      String userInput = "-";
  
      while (!userInput.equals("q")) {
          System.out.println("Commands: 'a' to add, 'd' to delete, 'e' to edit, 'q' to quit");
          userInput = scnr.next();
  
          if (userInput.equals("a")) {
              System.out.println("Year: ");
              int year = scnr.nextInt();
              System.out.println("Make: ");
              String make = scnr.next();
              System.out.println("Model: ");
              String model = scnr.next();
              System.out.println("Color: ");
              String color = scnr.next();
              System.out.println("Mileage: ");
              int mileage = scnr.nextInt();
  
              VehicleInventory userCar = new VehicleInventory();      
              userCar.setMake(make);
              userCar.setModel(model);
              userCar.setYear(year);
              userCar.setColor(color);
              userCar.setMileage(mileage);
              userCar.print();
  
              addCar(car, userCar);
          }
  
          if (userInput.equals("d")) {
              for (int i = 0; i &lt; car.size(); ++i) {
                  System.out.print((i + 1) + " ");
                  car.get(i).print();
              }
  
              System.out.println("List number: ");
              int userNum = scnr.nextInt();
              car.remove(userNum - 1);
              System.out.println("count: " + car.size());
          }
  
          if (userInput.equals("e")) {
              for (int i = 0; i &lt; car.size(); ++i) {
                  System.out.print((i + 1) + " ");
                  car.get(i).print();
  
              }
  
              System.out.println("List number: ");
              int userNum = scnr.nextInt();
              car.get(userNum - 1);
  </code></pre>