Question: public class Cylinder { public void smoothen ( ) { System.out.printin ( Smoothening . . ) ; } } public abstract class Vessel
public class Cylinder
public void smoothen
System.out.printinSmoothening;
public abstract class Vessel
private Engine e;
implements Steerable f
public Engine getEngine
return e;
public void setEngine Engine e
this.e e;
public abstract void turnon;
public class Engine
private Cylinder y;
private int cyls ;
static final int maxCyLinders ;
public void addCylinder Cylinder y
if cyls maxCyLinders
this.ycyls y;
public interface Steerable
public void turnString s;
public class Boat extends Vessel
public void turnStrings
System.out.printlnSteering s;
public void turnon
System.out.printlnTurn On;
public class Factory
public void build
Boat b new Boat;
Engine e new Engine;
boolean needsCylinder true;
Add just one cylinder if needed
if needsCylinder
Cylinder c new Cylinder ;
csmoothen;
eaddCylinder c;
b setEnginee;
Please create a structural class diagram of the above code. Include all classes, associations complete with needed cardinalities and needed arrowtips specializations and realizations. Use wwwdraw.io to create the diagram,
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
