Bird
0
0

What is wrong with this application.properties line?

medium📝 Debug Q14 of 15
Spring Boot - Fundamentals
What is wrong with this application.properties line?
server.port-8080
AThe port number 8080 is invalid
BThe key and value are separated by a dash instead of equals sign
CThe key should be <code>port.server</code> instead
DThere should be no spaces around the dash
Step-by-Step Solution
Solution:
  1. Step 1: Check property syntax

    Properties require key and value separated by an equals sign (=), not a dash (-).
  2. Step 2: Validate the key and value

    The key server.port is correct, and 8080 is a valid port number.
  3. Final Answer:

    The key and value are separated by a dash instead of equals sign -> Option B
  4. Quick Check:

    Use '=' to separate key and value [OK]
Quick Trick: Always use '=' between key and value in properties [OK]
Common Mistakes:
  • Using dash instead of equals sign
  • Swapping key parts order
  • Thinking spaces fix the syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes