Slides 09
Slides 09
Slides 09
Polymorphism
Polymorphism
• Polymorphism is an object-oriented concept that
allows us to create versatile software designs
Holiday
Holiday day;
day = new Christmas();
Christmas
day.celebrate();
StaffMember
Volunteer Employee
Executive Hourly
Speaker current;
current.speak();
• In more detail:
find the smallest value in the list
switch it with the value in the first position
find the next smallest value in the list
switch it with the value in the second position
repeat until all values are in their proper places
• In more detail:
consider the first item to be a sorted sublist (of one item)
insert the second item into the sorted sublist, shifting the
first item as needed to make room to insert the new
addition
insert the third item into the sorted sublist (of two items),
shifting items as necessary
repeat until all values are inserted into their proper
positions
• The user can browse the disk and filter the file
types displayed