void PrintStaticNameAndAge<T>() where T : IMyInterface { Console.WriteLine($"Name: {T.GetName()}; Age: {T.GetAge()}"); } static void Test() { PrintStaticNameAndAge<MyClass>(); // Prints "Name: Ben; Age: 33" to console }