Created
September 27, 2019 03:46
-
-
Save sohanmanju/f16dd3132ec9462c21a39cb824a7ff01 to your computer and use it in GitHub Desktop.
Java Assignment Question 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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