99.6k views
1 vote
Create a parent class called Shape with width and height parameters of type double and a function that returns the area of the shape, which simply returns 0. Then define two subclasses, Rectangle, and Triangle, that override the area function to return the actual area (width*height for Rectangle and 1/2*width*height for Triangle).

The code must be in java

User Stas
by
4.6k points

1 Answer

2 votes

Answer:

umm im not sure tbh

Step-by-step explanation:

User Brian Hadaway
by
4.0k points