0

Why my code error? (Project 5)

class Square extends Shape { public int area2; public Square (int x) { width =x; } public void area() { area2 =width*width; System.out.println (area2 ); } } class Circle extends Shape { public double area1; public Circle (int y) { width =y; } public void area() { area1 =Math.pI*width*width; System .out .println (area1); } }

8th Jan 2022, 8:13 AM
S.kajiththa
3 Answers
0
Yeah u missing Shape class
8th Jan 2022, 9:24 AM
Dennis Torhov
Dennis Torhov - avatar
0
Sorry I couldn't clear this code
8th Jan 2022, 11:44 AM
S.kajiththa
- 1
Where is the Shape class.
8th Jan 2022, 8:43 AM
FanYu
FanYu - avatar