1
Answer

c# generics - need help

anonymous

anonymous

11y
1k
1
For the example on the code below, which of the following statements are true?

public class MyContainer<T> where T: class, IComparable

{
//Insert code here
}
I. MyContainer class demands that the generic parameter implements IComparable interface.
II. The compiler will report an error for that code block.-False
III. There are multiple constraints on MyContainer generic parameter definition. -True
IV. MyContainer class demands that the generic parameter is of reference type and also implements the IComparable interface. - True
a) I and II only
b) I, III and IV only
c) II and III only
d) All above
e) None of the above
Answers (1)