Bird
0
0

You wrote this in application.properties:

medium📝 Debug Q6 of 15
Spring Boot - Application Configuration
You wrote this in application.properties:
server.port: 9090

Why does the server still start on port 8080?
ABecause 9090 is reserved and ignored by Spring Boot
BBecause colon syntax is invalid in properties files, so property is ignored
CBecause server.port must be set in YAML only
DBecause the file name is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Check properties file syntax

    Properties files require key=value syntax. Using colon instead of equals causes the line to be ignored.
  2. Step 2: Understand default behavior

    Since the property is ignored, Spring Boot uses the default port 8080.
  3. Final Answer:

    Because colon syntax is invalid in properties files, so property is ignored -> Option B
  4. Quick Check:

    Properties syntax error = property ignored, default used [OK]
Quick Trick: Use '=' in properties files, not ':' [OK]
Common Mistakes:
  • Using YAML syntax in properties files
  • Assuming port 9090 is invalid
  • Thinking server.port only works in YAML

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes