title: Trying to make a 2d array program to store a list of Car objects
body: <p>Struggling with a little project I've set myself to learn Java. My goal is to create a program to store a list of Car objects.  Then to allow the user to search for a particular car and output all of them if they exist.  The car object should contain model name, registration number, vin and colour. Here is what I have so far:</p>
  
  <pre><code>package carObjects;
  
  public class cars {
  
      public static int length;
      private String modelName;
      private String carColour;
      private int regNumber;
      private int vin;
  
      public cars(String string, String string2, int i) {
  
      }
  
      public String toString() {
          return "Model Name: " + modelName + "Registration Number: " + regNumber
                  + "Vin" + vin + "Car Colour:  " + carColour;
      }
  
      public String getLast() {
          return modelName;
      }
  }
  
          for (int i = 0; i &lt; cars.length; i++) {
              cars[i] = new cars("A", "B", 10);
          }
  
          for (cars p : cars) {
              System.out.println(p.getLast());
  
          }
      }
  }
  </code></pre>