Complete the code to declare a generic class with two type parameters.
public class Pair<[1], U> { }
The first generic type parameter is usually named T by convention.
Complete the method signature to use two generic parameters.
public void Swap<[1], V>(ref T a, ref V b) { }The method uses two generic parameters: T and V.
Fix the error in the generic class declaration.
public class Container<[1], U> { }
Generic type parameters must be valid identifiers, usually a single uppercase letter like T.
Fill both blanks to declare a generic method with two parameters and return type.
public [1] Combine<[2], V>(T first, V second) { return default; }
The method returns a string and has generic parameters T and V.
Fill all three blanks to declare a generic class with constraints on two parameters.
public class Repository<[1], [2]> where [3] : class where U : new() { }
The class has generic parameters T and U. The constraint where T : class applies to T.
