Hey guys,
I'm hoping you could explain why this doesnt work:
main file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TemplateApplication
{
class Program
{
static void Main(string[] args)
{
Class1<int> cl = new Class1<int>();
}
}
}
another template class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TemplateApplication
{
class Class1<T>
{
T t;
public T getValue()
{
return t;
}
}
}
Now why does it generate the following warning?
Warning 1 Field 'TemplateApplication.Class1<T>.t' is never assigned to, and will always have its default value C:\Users\John\Documents\Visual Studio 2008\Projects\TemplateApplication\TemplateApplication\Class1.cs 10 11 TemplateApplication