98-361 · Question #249
You have a class with a property. You need to ensure that consumers of the class can write to the value of the property. Which keyword should you use?
The correct answer is C. Set. The set { } implementation receives the implicit argument "value." This is the value to which the property is assigned. * Property. On a class, a property gets and sets values. A simplified syntax form, properties are implemented in the IL as methods (get, set).
Question
You have a class with a property. You need to ensure that consumers of the class can write to the value of the property. Which keyword should you use?
Options
- AAdd
- Bvalue
- CSet
- DGet
How the community answered
(31 responses)- A10% (3)
- B6% (2)
- C81% (25)
- D3% (1)
Explanation
The set { } implementation receives the implicit argument "value." This is the value to which the property is assigned. * Property. On a class, a property gets and sets values. A simplified syntax form, properties are implemented in the IL as methods (get, set).
Topics
Community Discussion
No community discussion yet for this question.