Question: The Java program shown in the next pages is implemented with respect to Composite design pattern. You are asked to respond to the following questions:





Simple and compound graphical shapes Tisis cxample shows how to create complex graphical shapen composed of simpler shapes and treat beth of the= unilsemby. Phapes B shapes/shape.fava: Comenon shape interface package refactaring.tari.coepssite.warylu.shapet; iepert jevinastioj pebtic imterface shepn int erixiy Lat entri 3 is int fetaiatiod hi int getmeighilbt paid anine(lat x, let y y) Meetean istesidebuntat int x, int off vale ielect( ) nele inselacti if. bestean isbetectedcli vile paintiedosics crighacs)i Bi shapes/Baseshape.java: Abstract shape with bunic functionuty lepert javaidest of abutract class buzwithape inelenenta shape I. pablic iat af pebtie iat yd pubic cabae sotarin prinate beelaik welected " felae; this, s = ti shis. = yi ahibrialeer + riseri ) isentriae pablic iat matx!) I returs 3.4 atwereride beblie int setrid i metura zi leseniride mutsic iat gntimittich 1 returs Iti 1 abverride Fetura ind neverride notic beolean isirsidebousds iat in iet v) i reternx>getx{)isxgetx{)isx
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
