?
Which of the following statements are valid in the following C# code snippet?
Which of the following statements are valid in the following C# code snippet?
public class Generic<T>
{
public T Field;
public void testSub()
{
T i = Field + 1;
}
}
class Program
{
static void Main(string[] args)
{
Genericlt;int>g = new Genericlt;int>();
g.testSub();
}
}
public class Generic<T>
{
public T Field;
public void testSub()
{
T i = Field + 1;
}
}
class Program
{
static void Main(string[] args)
{
Genericlt;int>g = new Genericlt;int>();
g.testSub();
}
}
Join the Discussion
Login to post a comment or share your explanation.
Login