I've the following class
MyClass
{
public int Id {get;set;}
public string Name {get;set;}
public List<string> FriendNames {get;set;}
public MyClass()
{
FriendNames = new List<string>();
}
}
Is it correct to initialise the List like I've done or should it be
this.FriendNames = new List<string>;
Is there any difference ?
Then in my code I can create a instance like
MyClass oMyClass = new MyClass();
oMyClass.Id = 1;
oMyClass.Name = "Bob Smith";
oMyClass.FriendNames.Add("Joe King");