Generic Type Constraint in Visual Basic

In C #, you can restrict the generic type:

public class Test<T> where T : SomeBaseClass 

Can you do the same in Visual Basic?

+4
source share
1 answer

Yes. You do it like:

 Public Class Test(Of T As SomeBaseClass) 

For more information, see Documentation on Constraints in Generic Types .

+5
source

All Articles