Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help ASAP! USING JAVA and please show the OUTPUT!! Thanks in advance! (10 pts) Define a class named Square Square must extend Rectangle Square

Please help ASAP! USING JAVA and please show the OUTPUT!!
Thanks in advance!
image text in transcribed
image text in transcribed
(10 pts) Define a class named Square Square must extend Rectangle Square must have a constructor with signature: Square(double length) e Square's constructor must call Rectangle's constructor (10 pts) Define a class named ShapeList ShapeList must extend ArrayList ShapeList must have a method with signature: ShapeList largestShapes0 . The largestShapes method must return a ShapeList that contains all Shapes with the largest area ShapeList must have a method with signature: boolean hasDistinctAreas0 . The hasDistinctAreas method returns true means that: o for all Shape A and Shape B in the ShapeList, if A and B have the same area, then A.equals(B) is true o in other words, it returns true if distinct shapes have distinct areas (10 pts) Define a class named Main Main must contain a method with signature: static void main(String[] args) . The main method must: o create an instance of ShapeList and populate this list with at least 8 distinct Rectangle objects o call the largestShapes method and print the result o call the hasDistinctAreas method and print the result Back to Homepage

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

CALCULATOR PRINTER VERSION

Answered: 1 week ago