Good Example:
public class Car { private String model; private int year; public Car(String model, int year) { this.model = model…