anonymous

anonymous

  • NA
  • 1
  • 2.3k

c# generics - need help

Dec 28 2013 3:48 PM
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)