title: Creating a car class in java
body: <p>Okay, I need to write code that makes this file </p>
  
  <pre><code>public class HW1tester
  {
      public static void main(String[] args)
      {    
          Car car1 = new Car();
          Car car2 = new Car("Ford", 2013, 20000);
          Car car3 = new Car("Audi", 2012, 25000);
          Car car4 = new Car();
  
          car2.setPrice(22000);
          car2.setYear(2011);
  
          car4.setBrand("Cadillac");
  
          System.out.println("This car is " + car1.getBrand() + ", year " + car1.getYear() + ", price " + car1.getPrice());
          System.out.println("This car is " + car2.getBrand() + ", year " + car2.getYear() + ", price " + car2.getPrice());
          System.out.println("This car is " + car3.getBrand() + ", year " + car3.getYear() + ", price " + car3.getPrice());
          System.out.println("This car is " + car4.getBrand() + ", year " + car4.getYear() + ", price " + car4.getPrice());
  
          System.out.println("The total car number is: " + car1.getNumber());
          System.out.println("The total car number is: " + car2.getNumber());
          System.out.println("The total car number is: " + car3.getNumber());
          System.out.println("The total car number is: " + car4.getNumber());
  
     }
  }
  </code></pre>
  
  <p>So far I have this, but I'm not sure what the hell I'm doing wrong.</p>
  
  <pre><code>public class Car 
  {
      private int yearModel;
      private String brand;
      private int priceModel;
      private int numberModel;
  
      public Car(String b, int year, int price, int number)
      {
          yearModel = year;
          brand = b;
          priceModel = price;
          numberModel = number;      
      }
  
      public int getYear()                
      {
          return yearModel;
      }
  
      public String getBrand()
      {
          return brand;
      }
  
      public int getPrice()
      {
          return priceModel;
      }
  
      public int getNumber()
      {
          return numberModel;
      }
  
      public void setYear(int year)
      {
          yearModel = year;
      }
  
      public void setBrand(String carBrand)
      {
          brand = carBrand;
      }
  
      public void setPrice(int price)                        
      {
          priceModel = price;   
  
      public void setNumber(int number)
      {
          numberModel = number;
      }
  }
  </code></pre>
  
  <p>Everytime I run the first code right now it just gives me errors on car1, car2, etc I just can't seem to see what I'm doing wrong at all, I hope somebody can help me out. By the way, I can't make ANY changes to HW1tester.</p>