SE450
:
Polymorphism
[12/41]
Which
getIconWidth
method is called?
Could be
MarsIcon.getIconWidth
ImageIcon.getIconWidth
. . .
Depends on object to which
anIcon
reference points, e.g.
showMessageDialog(..., new MarsIcon(50))
Polymorphism: Select different methods according to actual object type