Multiple choice technology programming languages

What’s the difference between a class field property ?

  1. A field always has Get and Set Methods

  2. A property always has Get and Set Methods

  3. Both 1 and 2

  4. None of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Neither fields nor properties always have Get and Set methods. In .NET, fields are direct variable members and have no methods. Properties can have Get only, Set only, both, or neither (in rare cases like write-only properties). Therefore, statements A and B are both incorrect, making D the correct answer.