+ 1
14th Feb 2020, 8:36 PM
Денис Лапшин
Денис  Лапшин - avatar
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.
14th Feb 2020, 8:43 PM
Jianmin Chen
Jianmin Chen - avatar
+ 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);
14th Feb 2020, 8:46 PM
A͢J
A͢J - avatar
+ 1
thank you both, i understand my mistake
14th Feb 2020, 8:59 PM
Денис Лапшин
Денис  Лапшин - avatar