C# Programming - Generics - Discussion
Discussion Forum : Generics - General Questions (Q.No. 6)
6.
For the code snippet given below, which of the following statements is valid?
public class Generic<T>
{
public T Field;
}
class Program
{
static void Main(string[ ] args)
{
Generic<String> g = new Generic<String>();
g.Field = "Hello";
Console.WriteLine(g.Field);
}
}
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers