Skip to content
Sharp

Spring Core · interview question

In Spring Boot, which of the following is the correct way to inject a configuration property from application.properties?

Multiple choiceEasychapter-9-curatedpremiumspring-coreapplication-properties
Choose one answer
Answer and explanation

Correct answer

C. @Value("${property.name}")

Why

The @Value annotation is used to inject values from the application.properties file into Spring components. The syntax is @Value("${property.name}").

Test yourself on Spring Core

A free test with instant, explained results. No account needed.

Start free test
All Spring Core questions →