Question: Some books on object-oriented programming recommend using inheritance so that the class Circle extends the class java.awt.Point. Then the Circle class inherits the setLocation method
Some books on object-oriented programming recommend using inheritance so that the class Circle extends the class java.awt.Point. Then the Circle class inherits the setLocation method from the Point superclass. Explain why the setLocation method need not be overridden in the subclass. Why is it nevertheless not a good idea to have Circle inherit from Point? Conversely, would inheriting Point from Circle fulfill the is-a rule? Would it be a good idea?
Step by Step Solution
3.52 Rating (166 Votes )
There are 3 Steps involved in it
ANSWER The setLocation method need not be overridden in the subclass because it does exactly what is ... View full answer
Get step-by-step solutions from verified subject matter experts
