Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

implement the given UML. You have one interface called '_Area' and one abstract class called '_Shape'. Class '_Shape' will be used as a super class.

implement the given UML. You have one interface called '_Area' and one abstract class called '_Shape'. Class '_Shape' will be used as a super class. Overide the methods toString, getArea and getName in all classes.

make a test class and . Make objects from class Rectangle , Then assign all objects to array of type _Shape, iterate over the array and call toString of each object.

The out put should be like:

Class name is Rectangle

Area =

image text in transcribed

Q- - You have an object from class _Shape, but we need to access setWidth from class rectangle, add the missing line to complete it and make sure it does not produce errors:

_Shape shape3 = new _Rectangle(8.94);

> _Area +getArea(): Double implements _Shape {abstract} - name : String + setName(String): void + getName(): String + toString(): void Extend: _Rectangle - width : Double - height: Double constructor _Rectangle(Double : w) constructor _Rectangle(Double :w, Double :h) + getArea(): Double + setWidth(Double : w): void + setHeight(Double :h) : void + getWidth(): Double + getHeight() : Double + to String(): void

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

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

What is the main objective of financial reporting?

Answered: 1 week ago

Question

Describe loss aversion and myopic loss aversion.

Answered: 1 week ago

Question

Explain why financial statement audits are necessary.

Answered: 1 week ago