previous
|
start
|
next
Polymorphism
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
previous
|
start
|
next