Bird
0
0

How can you combine YAML and properties files to manage configuration in Spring Boot?

hard📝 Application Q9 of 15
Spring Boot - Application Configuration
How can you combine YAML and properties files to manage configuration in Spring Boot?
AUse <code>application.yml</code> for common config and <code>application.properties</code> for overrides
BSpring Boot does not support mixing YAML and properties
CUse both files with same keys; properties override YAML
DUse YAML only for logging config
Step-by-Step Solution
Solution:
  1. Step 1: Understand Spring Boot config precedence

    Spring Boot loads both YAML and properties; last loaded overrides earlier.
  2. Step 2: Check mixing rules

    Properties file overrides YAML if keys overlap.
  3. Final Answer:

    Use both files with same keys; properties override YAML -> Option C
  4. Quick Check:

    Properties override YAML when keys conflict [OK]
Quick Trick: Properties override YAML if keys overlap [OK]
Common Mistakes:
  • Thinking mixing is unsupported
  • Assuming YAML always overrides
  • Limiting YAML to logging only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes