tags:

views:

104

answers:

2

Hi guys... I need ans for this problem badly--- difference between generics and polymorphism using code examples. I know its related somthing to compile time or binding but i am not sure..please help

A: 

Polymorphism:

http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming

Generics:

http://en.wikipedia.org/wiki/Generic_programming

Good luck with understanding the differences ;)!

Younes
A: 

Polymorphism is a property of classes, in that they implement a common interface, or are derived from a base class, implementing virtual methods in a different way to reflect the different behavior of derived classes.

Generics is a property of an algorithm, or a class implementing an algorithm (sort) or a common operation (lists), requiring the classes they deal with to have certain methods, properties, or interfaces.

devio
is there any code example that will make it clear?
Kelly
thnx for your help devio..appreciate it
Kelly