Answer:
public class Car {
private String __year_model;
private String __make;
private int __speed;
//Creating the constructor
public Car(String __year_model, String __make, int __speed) {
this.__year_model = __year_model;
this.__make = __make;
this.__speed = __speed;
}
//Creatining the set and get methods
public String get__year_model() {
return __year_model;
}
public void set__year_model(String __year_model) {
this.__year_model = __year_model;
}
public String get__make() {
return __make;
}
public void set__make(String __make) {
this.__make = __make;
}
public int get__speed() {
return __speed;
}
public void set__speed(int __speed) {
this.__speed = __speed;
}
}
Explanation:
As stated in the question, The class Car is created using Java programming language with the three attributes year_model, make and speed.
Constructors as well as set and get methods were also created for each of the fields.