Can one define multiple contraints for single type argument in Generic Class ?
Yes , one can specify multiple contraints for single type argument in Generic class.
Syntax below :
class B<T> where T:constraint1,contstaint2
B is Generic class
T is Type argument
constraint1 and contraint2 are Generic constraints.
So one can add as many constraints to Type argument seperated by comma.
Example below :
Categories: CSharp Interview Questions