Consider the java.awt.Rectangle
class and this subclass:
public class Square extends Rectangle { public Square(int x, int y, int width) { super(x, y, width, width); } }
What is true about this class?
What does the call
car.translate(x, y);
do in section 6.2 of the textbook?
It is often said that inheritance is overrated. For polymorphism, interfaces often suffice. Which of the following design patterns require the use of inheritance? Check all that apply, or leave all unchecked if inheritance isn't required for any.
Do problem 6.17 from your text book with a buddy.