using System; public class Student{} public class Teacher : Student{} public class GenericClassWithTypeConstraints where T1 : Student where T2 : Teacher {} class Test { static void Main() { var obj = new GenericClassWithTypeConstraints(); } }