exam questions

Exam 2V0-72.22 All Questions

View all questions & answers for the 2V0-72.22 exam

Exam 2V0-72.22 topic 1 question 36 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 36
Topic #: 1
[All 2V0-72.22 Questions]

Which statement is true about the @PropertySource annotation? (Choose the best answer.)

  • A. Used to designate the location of the application.properties file in a Spring Boot application.
  • B. Used to easily look up and return a single property value from some external property file.
  • C. Used to designate the file directory of the application.properties file in a Spring Boot application.
  • D. Used to add a set of name/value pairs to the Spring Environment from an external source.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
nesreenmhd123
3 months, 3 weeks ago
D is correct. https://docs.spring.io/spring-framework/reference/core/beans/environment.html#beans-using-propertysource
upvoted 4 times
...
Tolo01
6 months ago
Selected Answer: D
Option A is not correct: @PropertySource is not specifically used to designate the location of the application.properties file in a Spring Boot application. In a Spring Boot application, the application.properties file is automatically loaded from the classpath by default without needing to use @PropertySource. Option B is not entirely accurate: While you can use @PropertySource to load properties from an external property file, it allows you to load multiple key-value pairs rather than just a single property value. Option C is not correct: @PropertySource does not designate the file directory of the application.properties file in a Spring Boot application. Again, in Spring Boot, the application.properties file is automatically loaded from the classpath by default without needing to use @PropertySource.
upvoted 4 times
...
rhuanca
10 months, 1 week ago
why not D ? I can not see any problem with D
upvoted 1 times
...
zakupower
10 months, 3 weeks ago
Selected Answer: A
None are exactly correct. It is an annotation to be used in tests to specify properties files to be included. Also it overrides the standard application.properties file.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago