For the code snippet given below, which of the following statements are valid? public class MyContainer<T> where T: class, IComparable { //Insert code here } 1. Class MyContainer requires that it's type argument must implement IComparable interface. 2.Compiler will report an error for this block of code. 3. There are multiple constraints on type argument to MyContainer class. 4. Class MyContainer requires that its type argument must be a reference type and it must implement IComparable interface.

Review the verified answer and explanation for this DemoPaper-Pakistan past-paper question on CampusFin.

For the code snippet given below, which of the following statements are valid? public class MyContainer<T> where T: class, IComparable { //Insert code here } 1. Class MyContainer requires that it's type argument must implement IComparable interface. 2.Compiler will report an error for this block of code. 3. There are multiple constraints on type argument to MyContainer class. 4. Class MyContainer requires that its type argument must be a reference type and it must implement IComparable interface. Answer: 3 and 4 Only

Question context

This question is part of 🧩 C# Programming within the broader 💻 Programming subject and appears in the DemoPaper-Pakistan preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.