How do I create a class with an array within it?
I'm trying to create a class for people with an array of hobbies within it, but cannot figure out how to do that, can anyone tell me how I can go about doing this?
internal class person
{
public string name { get; set; }
public int age { get; set; }
public int numberOfHobbies { get; set; }
//how do I do an array?
//public string[numberOfHobbies] hobbies { get; set; }
}
3 Replies