This must be really simple but just not getting my syntax right here. let's say we have classes like two below:
class Student
{
Subject[] subjects;
}
class Subject
{
string Name;
string referenceBook;
}
Here is my code:
Student univStudent = new Student();
Now, I want to add subjects here but not able to do something like
univStudent.subjects.add(new Subject{....});
How do i add items to this object array?