Bird
0
0

What happens when you define multiple profiles in Spring Boot and activate one of them?

easy📝 Conceptual Q1 of 15
Spring Boot - Application Configuration
What happens when you define multiple profiles in Spring Boot and activate one of them?
AOnly the properties from the active profile override the default properties
BAll profiles' properties are merged regardless of activation
CProfiles are ignored unless explicitly referenced in code
DSpring Boot disables default properties when any profile is active
Step-by-Step Solution
Solution:
  1. Step 1: Understand profile activation

    Activating a profile tells Spring Boot to load properties specific to that profile.
  2. Step 2: Property overriding behavior

    Properties in the active profile override those in the default application.properties.
  3. Final Answer:

    Only the properties from the active profile override the default properties -> Option A
  4. Quick Check:

    Active profile properties take precedence [OK]
Quick Trick: Active profile properties override defaults [OK]
Common Mistakes:
  • Assuming all profiles' properties are merged
  • Thinking profiles disable default properties
  • Believing profiles are ignored without code changes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes