Mega Code Archive

 
Categories / C# Tutorial / Generic
 

Declaring a Generic Interface, Implementing a Generic Interface

interface IPair<T> {     T First     {         get;         set;     }     T Second     {         get;         set;     } } public struct Pair<T>: IPair<T> {     public T First     {         get         {             return _First;         }         set         {             _First = value;         }     }     private T _First;     public T Second     {         get         {             return _Second;         }         set         {             _Second = value;         }     }     private T _Second; }