Results 1 to 2 of 2

Thread: When should i use a property and not a field?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Posts
    18

    When should i use a property and not a field?

    Hello ppl,

    In vb.net data-members can be fields, but also properties. A property looks
    similar to a field, but is defined by it's get- and set-accessors.
    However i don't understand the use of a property. Is it not easier
    just to use a field instead?
    Can smb explain this to me please?

    Thanks,

    A Pure Mind

  2. #2
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    With Fields you can't encapsulate your object's data, with Properties you can.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width