Vidyalelo
C# Programming · Q67

Delegates and Events in C Sharp

Programming · C# Programming · question 67

Q67

Which statement is valid for the following C# code snippet? public class Generic public T Field; class Program static void Main(string[] args) Generic g = new Generic (); g.Field = "Hi"; Console.WriteLine(g.Field);

A.
Compile time error
B.
Generic being a keyword cannot be used as a class name
C.
Runtime error
D.
Code runs successfully
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board