How to return generic abstract class?
<p>I have something like this: </p>

<pre><code>abstract class BaseClass&lt;T&gt;
{
    protected BaseClass(){}
}

class Class1 : BaseClass&lt;Class1&gt;
{
    public static Class1 Instance = new Class1();
    private Class1(){}    
}

class Class2 : BaseClass&lt;Class2&gt;
{
    public static Class2 Instance = new Class2();
    private Class2(){}   
}

...
public BaseClass&lt;T&gt; Method&lt;T&gt;(int z) where T: BaseClass&lt;T&gt;
{
    switch(z)
    {
        case 1: 
            return Class1.Instance;
        case 2:
            return Class2.Instance;
    }
}
</code></pre>

<p>That is very important that those classes cannot be instantiated since their construstors are private so we cannot do like </p>

<p><code>public BaseClass&lt;T&gt; Method&lt;T&gt;(int z) where T: BaseClass&lt;T&gt;,</code> <strong>new()</strong></p>

<p>How can I use abstract class as return type ?? I just can not work this out. Would appreciate for any assisstance here.</p>
