|
-
Sep 8th, 2010, 01:55 PM
#8
Re: Collection error
You have a few problems with your class design.
1) scores itself should BE a collection, not contain an internal collection
2) all your fields are public, and you also expose read only properties for them. If the fields are public, then can be directly accessed and modified outside the class, which means the readonly fields are useless and don't encapsulate the internal values of the class as they should
3) Your constructor is useless because all it does is set numeric variables to 0 which are actually already 0 since numeric value types have a default value of 0. If you don't specify a constructor (sub new) in a class, a parameterless one is automatically generated when compiled.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|