Some books on object-oriented programming recommend using inheritance so that the class Circle extends the class java.awt.Point.

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 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?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: