Skip to content
Sharp

Spring Core · interview question

How can you configure a Spring Boot application to use different properties for development and production environments?

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

Correct answer

C. Use separate application-dev.properties and application-prod.properties files, activated via Spring Profiles.

Why

Spring Boot allows you to have separate properties files like application-dev.properties and application-prod.properties. You can activate these files through Spring Profiles, enabling the application to automatically use the correct settings for each environment without manual intervention.

Test yourself on Spring Core

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

Start free test
All Spring Core questions →