Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Car {
- private String registration;
- private int doors;
- private String colour;
- private CarDealer supplier;
- private static int totalCars = 0;
- public Car() {
- this.registration = null;
- this.doors = 0;
- this.colour = null;
- this.supplier = null;
- ++totalCars;
- }
- public Car(
- String registration,
- int doors,
- String colour,
- CarDealer supplier
- ){
- this.registration = registration;
- this.doors = doors;
- this.colour = colour;
- this.supplier = supplier;
- ++totalCars;
- }
- public static int getTotalCars() {
- return totalCars;
- }
- public static void setTotalCars(int totalCars) {
- Car.totalCars = totalCars;
- }
- public String getColour() {
- return colour;
- }
- public void setColour(String colour) {
- this.colour = colour;
- }
- public void setRegistration(String registration) {
- this.registration = registration;
- }
- public String getRegistration() {
- return registration;
- }
- public CarDealer getSupplier() {
- return supplier;
- }
- public void setSupplier(CarDealer supplier) {
- this.supplier = supplier;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement