Skip to content
Sharp

Spring Core · interview question

How can Spring Boot applications be configured to use environment variables?

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

Correct answer

B. By referencing them in application.properties with placeholders

Why

You can configure Spring Boot applications to use environment variables by referencing them in application.properties with placeholders, such as ${env.VARIABLE_NAME}. This allows dynamic configuration based on the environment.

Test yourself on Spring Core

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

Start free test
All Spring Core questions →