Question Typed Code M Quite Sure Isn T Working Please Help Thank Question Code Already Ty Q37176158

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:

10.2 A custom Rectangle class For this lab, you will create a custom version of the Rectangle class. This class should have i

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.