I have a question and I have typed my code but I’m not quitesure why it isn’t working? Please help. Thank you.
Question:
The code I have already typed:
public class Rectangle{
//instance variables
private double length;
private double width;
//default constructor
public Rectangle() { //need () for contructors
length = 1.0;
width = 1.0;
}
//ovarloaded constructor
public Rectangle(double length, double width) {
this.length = length;
this.width = width;
}
//accessor methods/getters
public double getLength(){
return this.length;
}
public double getWidth(){
return this.length;
}
//mutator/setter methods
public void setLength(double length){
this.length = width;
}
public void setWidth(double width){
this.width = width;
}
public double
OR
OR