Skip to content

Instantly share code, notes, and snippets.

@sohanmanju
Created September 27, 2019 03:46
Show Gist options
  • Save sohanmanju/f16dd3132ec9462c21a39cb824a7ff01 to your computer and use it in GitHub Desktop.
Save sohanmanju/f16dd3132ec9462c21a39cb824a7ff01 to your computer and use it in GitHub Desktop.
Java Assignment Question 4
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment