

MCQOPTIONS
Saved Bookmarks
1. |
Which statement is valid for the given snippet of code: public class Generic { public T Field; } class Program { static void Main(string[] args) { Generic g2 = new Generic(); Generic g3 = new Generic(); g2.Field = 8; g3.Field = 4; if (g2.Field % g3.Field == 0) { Console.WriteLine("A"); } else Console.WriteLine("Prints nothing:"); Console.ReadLine(); } } |
A. | Compile time error |
B. | A |
C. | Run time error |
D. | Code runs successfully but prints nothing |
Answer» C. Run time error | |