Discussion :: Generics
-
For the code snippet given below, which of the following statements are valid?
public class MyContainer
where T: IComparabte { // Insert code here } - Class MyContainer requires that it's type argument must implement IComparabte interface.
- Type argument of class MyContainer must be IComparabte.
- Compiler will report an error for this block of code.
- This requirement on type argument is called as constraint.
Answer : Option C
Explanation :
No answer description available for this question.
Be The First To Comment