December 2001
Beginner
976 pages
22h 4m
English
You know you can have array fields in structures and classes. You also can have attribute of type array, or more generally parameterized attributes. How can you implement these attributes using properties? Let's look at an example. Assume that your Person class can have a number of accounts with a financial institution. You plan to store the balances of these accounts in the Person class. You can further assume (for simplification) that the maximum number of accounts is five. You decide to implement this attribute using an array field of five Decimal values. If you were to use the public array field, you could write the class as follows:
Public Class Person
Private m_name As String
Private m_dob As Date
Public m_balances() ...Read now
Unlock full access