

MCQOPTIONS
Saved Bookmarks
1. |
Which of the following statements is valid about advantages of generics? public class Generic { public T Field; } class Program { static void Main(string[ ] args) { Generic g = new Generic(); g.Field = "Hello"; Console.WriteLine(g.Field); } } |
A. | Generics shift the burden of type safety to the programmer rather than compiler. |
B. | Generics require use of explicit type casting. |
C. | Generics provide type safety without the overhead of multiple implementations. |
D. | Generics eliminate the possibility of run-time errors. |
Answer» D. Generics eliminate the possibility of run-time errors. | |