Create and complete the implementation of the
Your class should be public, not final and not abstract, inherit from the
and provide the following methods:
- Constructor that takes a
Doubleparameter. Creates a new
Squarewith the passed side length. You can assume that the passed size is greater than zero. You should call the
Shapeconstructor and pass it the
String"square" to identify the type of this shape.
- Implement the
areathat takes no arguments and returns a
Double. Return the area of this shape:
side * side.
public boolean equals(Object other). Return
Squarewith the same width and height, and
falseotherwise. Note that
nullor not a
Finally, note that your class should not expose any of its internal state publicly.