Tuesday, March 13, 2012

Define Generics

C# has two separate mechanisms for writing code that is reusable across different
types: inheritance and generics. Whereas inheritance expresses reusability with a
base type, generics express reusability with a “template” that contains “placeholder”
types. Generics, when compared to inheritance, can increase type safety and reduce
casting and boxing.

1 comment: