Quiz · Lists, dictionaries and sets · lesson 5 of 10Quiz — why genericsWhat are generics in C#, and what problem do they solve over using object?[A]Generics wrap every element in object while the program runs and cast it back on each read. They only make the code shorter to write: a wrong type is still caught only at run time, exactly as it is with an old ArrayList of object.[B]Generics give a type or method a type parameter T, so one List<T> serves List<int> and List<string>. The compiler checks the element type: no casts, and a wrong type does not compile, while an ArrayList of object fails only at run time.[C]Generics let one list hold values of several types at once, numbers and strings side by side. The T in List<T> means any type at all, so a List<int> takes a string too, and the compiler leaves every type check to run time.[D]Generics pick the element type only when the program runs: a List<T> looks at the first value added to it and fixes T from that value. Until the first Add the list accepts anything, and adding a value of a wrong type after it throws an exception.← BackWhat <T> meansNext →Dictionary