Oracle
1Z0-805 · Question #47
1Z0-805 Question #47: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #47. The question stem and answer options stay visible for context.
Question
Oracle 1Z0-805 Exam Two companies with similar robots have merged. You are asked to construct a new program that allows the features of the robots to be mixed and matched using composition. Given the code fragments: public class CrusherRobot { public void walk () {} public void positionArm (int x, int y, int z) {} public void raiseHammer() {} public void dropHammer() {} } public class GripperRobot { public void walk() {} public void moveArm (int x, int y, int z) {} public void openGripper () {} public void closeGripper() {} } When applying composition to these two classes, what functionality should you extract into a new class?
Options
- AA new BasicRobot class that provides walking.
- BA new BasicRobot class that combines gripping and hammering.
- CA new BasicRobotFactory class to construct instances of GripperRobot.
- DA new BasicRobotFactory class to construct instances of CrusherRobot.
Unlock 1Z0-805 to see the answer
You've previewed enough free 1Z0-805 questions. Unlock 1Z0-805 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.