6.4. Composite Classes, Revisited
You might recall that when we talked about the fields of the Student class back in Chapter 3, we held off on assigning types to a few of the items shown in Table 6-1.
Field Name | Data Type |
---|---|
name | string |
studentID | string |
birthdate | System.DateTime |
address | string |
major | string |
gpa | double |
advisor | Professor |
courseLoad | ??? |
transcript | ??? |
Armed with what we now know about collections, we can go back and assign types to the courseLoad and transcript fields.
6.4.1.
6.4.1.1. courseLoad
The courseLoad field is meant to represent a list of all Course objects that the Student is presently enrolled in. So, it makes perfect sense that this field be declared to be simply a standard collection ...
Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.