Discussion :: Generics
-
For the code snippet given below, which of the following statements is valid?
public class GenericT> { public T Field; } class Program { static void Main(string[ ] args) { Generic
g = new Generic (); g.Field = "Hello"; Console.WriteLine(g.Field); } }
A.
It will print string "Hello" on the console. |
B.
Name Generic cannot be used as a class name because it's a keyword. |
C.
Compiler will give an error. |
D.
Member Field of class Generic is not accessible directly. |
E.
None of the above. |
Answer : Option A
Explanation :
No answer description available for this question.
Be The First To Comment