Answers for "add items to a class array"

0

add items to a class array

class Student
{
    IList<Subject> subjects = new List<Subject>();
}

class Subject
{
    string Name;
    string referenceBook;
}

//Now you can say:

someStudent.subjects.Add(new Subject());
Posted by: Guest on April-02-2020

Browse Popular Code Answers by Language