Properties

The default access modifier is private
A property is similar to a field except that you do not have to use additional methods to manage your private fields.
What can a property do that a field can't
A property that has both a set and get component is considered read-write

  • they can validate data before it is actually changed

  • they can take action when data is changed

  • they can change the values of other variables

  • they can raise exceptions




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext