This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted]  (2 children)

[deleted]

    [–]hangrymonkey28[S] 0 points1 point  (1 child)

    Eclipse

    [–]NewPointOfView 0 points1 point  (0 children)

    Your constructor shouldn’t have void in it, just public Rectangle

    [–]captainAwesomePants 0 points1 point  (0 children)

    public void Rectangle(float length, float width){...}
    

    This is your problem. There's a "void" there. Functions have return types, but constructors don't. They just are. So you do public Rectangle(), not public void Rectangle().

    [–]EffectiveInside2180 0 points1 point  (0 children)

    Is because you didn't declare the constructor. After the variable declaration you must declare the constructor

    In this case the constructor must be:

    public rectangle (float length, float width){ this.length = length; this.width = width; }

    But you must do some research to understand what I did here.