Bird
0
0

Identify the error in this application.properties snippet:

medium📝 Debug Q14 of 15
Spring Boot - Application Configuration
Identify the error in this application.properties snippet:
server.port: 9090
spring.application.name=MyApp
AKey names should be uppercase
BNo error, syntax is correct
CUsing colon instead of equal sign for server.port
DMissing quotes around MyApp
Step-by-Step Solution
Solution:
  1. Step 1: Check key-value separator

    In application.properties, both equal sign (=) and colon (:) are valid separators, as per Java Properties format.
  2. Step 2: Verify other syntax rules

    Keys use lowercase with dots, quotes optional for simple values like 'MyApp' and numbers.
  3. Final Answer:

    No error, syntax is correct -> Option B
  4. Quick Check:

    = and : both valid [OK]
Quick Trick: Properties support =, :, or space as separators [OK]
Common Mistakes:
  • Thinking colon (:) is invalid separator
  • Thinking quotes are mandatory for strings
  • Assuming uppercase keys are required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes