Answer:
Public int getHeight(){
return height;
}
public int getWidht(){
return widht;
}
public int setHeight(int change){
height = change;
}
public int setWidht(int change){
widht = change;
}
public int getPerimeter(){
int perimeter = 2 ( getWidht() + getHeight ());
return perimeter;
If the width is 10 and height 4, the perimeter should be 28.
Step-by-step explanation:
An accessor in Java is a method that is used to get the value of an object variable. The program above has three accessor methods, getHeight, getWidht and getPerimeter.
Mutators are methods that is used to change of mutate the value of object variables. They are denoted or identified by the set prefix in their names. From the class code, the mutator are setHeight and setWidht.