using System;
public class Starter {
public static void Main() {
MyClass obj = new MyClass();
obj.MethodA();
}
}
public class MyClass {
public void MethodA()
where T : XClass, new() {
Console.WriteLine("MyClass.MethodA");
T obj = new T();
obj.MethodB();
}
}
public class XClass {
public void MethodB() {
Console.WriteLine("XClass.MethodB");
}
}