98-361 · Question #103
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 D. 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
- Avalue
- Badd
- Cget
- Dset
How the community answered
(18 responses)- A6% (1)
- B11% (2)
- C6% (1)
- D78% (14)
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.