C# Programming - Generics - Discussion
Discussion Forum : Generics - General Questions (Q.No. 8)
8.
For the code snippet given below, which of the following statements are valid?
public class MyContainer<T> where T: class, IComparable
{
//Insert code here
}
- Class MyContainer requires that it's type argument must implement IComparable interface.
- Compiler will report an error for this block of code.
- There are multiple constraints on type argument to MyContainer class.
- Class MyContainer requires that its type argument must be a reference type and it must implement IComparable interface.
Discussion:
2 comments Page 1 of 1.
Santo said:
8 years ago
We couldn't understand the question?
Gloops said:
9 years ago
How is it possible to say that 4 is true and 1 is false ?
I should have said 3 and 4, but surely not 3 and 4 only.
I should have said 3 and 4, but surely not 3 and 4 only.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers