A single message “drawYourself()” is sent to two types of window objects. One type of window object responds by painting a bar chart. The other responds by displaying a photographic image. Which term best describes this scenario?
A. Inheritance
B. Composition
C. Abstraction
D. Polymorphism
Answer:D
A single message “drawYourself()” is sent to two types of window objects. One type of window object responds by painting a bar chart. The other responds by displaying a photographic image. Which term best describes this scenario?
A. Inheritance B. Composition C. Abstraction D. Polymorphism