제네릭으로 클래스를 선언했을 때, 비교연산자를 사용할 수 없다는 문제가 있다. IComparable인터페이스를 클래스 선언부에 사용해주면 비교 가능한 자료형만 받아올 수 있다. class Example where T : IComparable { // 클래스 구현 } class UseExample : IComparable { public int ID; public int CompareTo(UseExample other) { if(ID == other.ID) return 0; return ID > other.ID ? 1 : -1; } }