Bird
0
0

Given the following application.properties and application-dev.properties files, what will be the value of app.message if the active profile is dev?

medium📝 component behavior Q4 of 15
Spring Boot - Docker and Deployment

Given the following application.properties and application-dev.properties files, what will be the value of app.message if the active profile is dev?

application.properties:
app.message=Hello from default

application-dev.properties:
app.message=Hello from dev
AHello from default
BHello from dev
Capp.message not found
DApplication will fail to start
Step-by-Step Solution
Solution:
  1. Step 1: Understand profile-specific property overriding

    When a profile is active, its properties override the default ones.
  2. Step 2: Check which profile is active and property values

    The 'dev' profile is active, so 'app.message' from 'application-dev.properties' is used.
  3. Final Answer:

    Hello from dev -> Option B
  4. Quick Check:

    Active profile properties override default [OK]
Quick Trick: Active profile properties override defaults [OK]
Common Mistakes:
  • Assuming default properties always apply
  • Thinking both values merge
  • Expecting startup failure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes