The list doesn't add anything when the method is called, it throws an exception. How should it be done and is it possible to do without writing this:
public List<string> Mark = new List<string>();
I've done like this and this gives an exception
public class Student
{
protected List<string> _mark;
public List<string> Mark
{
get { return _mark; }
set { _mark = value; }
}
public void Get()
{
Mark.Add("Hello");
}
}
static void Main(string[] args)
{
Student a = new Student();
a.Get();
}