Broadcom-VMware
2V0-72.22 · Question #86
Which two ways to access the properties defined in an application.properties or application.yml file are correct? (Choose two.)
The correct answer is A. Through the getProperty() method of the Spring Environment object. B. Through a constructor parameter annotated with @Value. See the full explanation below for the reasoning.
Question
Which two ways to access the properties defined in an application.properties or application.yml file are correct? (Choose two.)
Options
- AThrough the getProperty() method of the Spring Environment object.
- BThrough a constructor parameter annotated with @Value.
- CThrough the getProperty() method of a Properties object.
- DThrough the getProperty() method of an ApplicationContext object.
- EThrough a constructor parameter annotated with @Property.
How the community answered
(28 responses)- A71% (20)
- C7% (2)
- D18% (5)
- E4% (1)
Community Discussion
No community discussion yet for this question.