+ 1
Why my code is not working? help me please
3 Answers
+ 5
Your code isn't working because your getArea() method of your Rectangle class requires two parameters, both doubles(width and height). I'm assuming, since you initialized the object with a 4 and 40 for width and height, you'd want to use getArea() to multiply those two and return a value. In that case, simply remove the parameters.
+ 3
Денис Лапшин You have created method with two parameter but you are calling method without passing parameters..
rectangle1.getArea();
Here should be
rectangle1.getArea(4, 40);
+ 1
thank you both, i understand my mistake



