April 2019
Intermediate to advanced
360 pages
9h 17m
English
Our solution involves two builder classes—PersonalRoaster and CommercialRoaster. The following code is the first half of the PersonalRoaster class. It implements the Builder interface and instantiates a Roaster object.
In this code section, there are four methods for building specific components, each utilizing the add() method:
public class PersonalRoaster implements Builder { private Roaster roaster = new Roaster(); @Override public void buildCoolingTray() { roaster.add("Personal Roaster Cooling Tray added"); } @Override public void buildExhaustSystem() { roaster.add("Personal Roaster Exhaust System added"); } @Override public void buildGasBurner() { roaster.add("Personal Roaster Gas Burner added"); } @Override public void ...
Read now
Unlock full access