public class Generic<T> { public T Field; } class Program { static void Main(string[] args) { Generic<String> g = new Generic<String>(); 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
d
Explanation: None.
Output :
Hello