PCPP-32-101 · Question #10
Which sentence about the @property decorator is false?
The correct answer is C. The @property decorator marks the method whose name will be used as the name of the. The @property decorator should be defined after the method that is responsible for setting an encapsulated attribute is a false sentence. In fact, the @property decorator should be defined before the method that is used to set the attribute value. The @property decorator and…
Question
Which sentence about the @property decorator is false?
Options
- AThe @property decorator should be defined after the method that is responsible for setting an
- BThe @property decorator designates a method which is responsible for returning an attribute
- CThe @property decorator marks the method whose name will be used as the name of the
- DThe @property decorator should be defined before the methods that are responsible for setting
How the community answered
(52 responses)- A2% (1)
- B4% (2)
- C87% (45)
- D8% (4)
Explanation
The @property decorator should be defined after the method that is responsible for setting an encapsulated attribute is a false sentence. In fact, the @property decorator should be defined before the method that is used to set the attribute value. The @property decorator and the setter and deleter methods work together to create an encapsulated attribute, which is used to provide control over the attribute's value.
Topics
Community Discussion
No community discussion yet for this question.