Generic classes and methods combine reusability, type safety and efficiency.Generics are most commonly used with collections and the methods that operate on them. Custom generic types and methods solutions are build with design patterns that are type-safe and efficient can … Continue reading
Before generics the best available method for comparing equality between objects was the virtual Object::Equals() and Object::ReferenceEquals() methods.
Before generics the best available method for sort comparing between objects was the IComparable interface.
Improvements introduced by generics to provide a strongly typed CompareTo() or Compare() methods.
Provides a set of built-in flexible delegates that can be used in order to reduce the number of delegates explicitly defined.
Improvements introduced by generics to provide a strongly typed Equals() method.
Nullables defines a structure that allows value types to have normal value or a NULL value. The object wrapps the value type in order to be assigned with NULL/NOTHING like a normal reference type.
A generic collection is strongly typed (type safe): it means that only a unique data type can be added to the collection. This way run-time type conversion and boxing / unboxing operations are avoided.
A generic type is a single programming element that adapts to perform the same functionality for a variety of data types.