In the line below:
public class Tree<TItem> where TItem : IComparable<TItem>
This line I'm creating the definition of type TItem
where TItem
implements the IComparable
interface, ie I'm creating a generic type definition that implements what was defined in the interface IComparable
as method e / or properties.
My question would be in the line below, where type T
implements a class
. Why does a class
and not a specific class? What is the purpose of creating a definition for type T
that implements a class
?
public class Repository<T> : IDisposable where T : class