Question: Please write a class according to the UML (Java) # denotes protected access > Shape #color:String red #filled: Boolean = true +Shape() +Shape (color:String, filled:boolean)

Please write a class according to the UML (Java)

Please write a class according to the UML (Java) # denotes protected

# denotes protected access > Shape #color:String "red" #filled: Boolean = true +Shape() +Shape (color:String, filled:boolean) +getColor(): String +setColor(color:String):void +isFilled(): boolean +setFilled(filled:boolean):void +abstract getArea(): double +abstract getPerimeter(): double +toString(): String extends "Shape[color=?, filled=?]" Circle #radius: double 1.0 +Circle() +Circle(radius:double) +Circle(radius:double, color:String, filled: boolean) +getRadius(): double +setRadius (radius: double):void +getArea(): double +getPerimeter(): double +toString(): String Rectangle #width: double 1.0 #length: double 1.0 +Rectangle() +Rectangle(width: double, length: double) +Rectangle(width:double, length: double, color:String, filled:boolean) +getWidth(): double +setWidth(width: double):void +getLength(): double +setLength(legnth: double):void +getArea(): double +getPerimeter(): double *+toString(): String "Circle(Shape[color=?, filled=?], radius=?]" "Rectangle Shape[color=?, filled=?], width=?, length=?]" Square +Square) +Square (side: double) +Square (side: double, color:String, filled: boolean) +getSide(): double +setSide (side: double):void +setWidth(side: double):void +setLength(side: double):void ---+toString(): String "Square[Rectangle(Shape[color=?, filled=?], width=?, length=?]]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!