What is the syntax for abstract class in c#.net?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, friends,

I tried to have 2 classes in an abstract class, but could not figure out the
syntax. I knew with 1 class the syntax is:

public abstract class MyClass<T> where T : class
{
}

Then I tried both

public abstract class MyClass<T1, T2> where T1, T2 : class
{
}

public abstract class MyClass<T1, T2> where T1 : class, T2 : class
{
}

but no luck.

Can any one help me with a reference paper or snippet on this? Thanks a lot.
 
public abstract class MyClass said:
{
}

public abstract class MyClass<T1, T2> where T1 : class, T2 : class
{
}

but no luck.

You need one where clause per parameter

public abstract class MyClass<T1, T2> where T1 : class where T2 :
class
{
}


Mattias
 
Back
Top