Join the growing community of curious minds on IDNLearn.com and get the answers you need. Our community is here to provide the comprehensive and accurate answers you need to make informed decisions.

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