Bird
0
0

Which of the following is the correct syntax to set the server port to 8081 in application.properties?

easy📝 Syntax Q12 of 15
Spring Boot - Fundamentals
Which of the following is the correct syntax to set the server port to 8081 in application.properties?
Aserver.port=8081
Bserver-port: 8081
Cserver_port=8081
Dport.server=8081
Step-by-Step Solution
Solution:
  1. Step 1: Recall Spring Boot property syntax

    Spring Boot uses dot notation with key=value pairs in application.properties.
  2. Step 2: Identify correct key for server port

    The correct key is server.port, and the value is set with an equals sign.
  3. Final Answer:

    server.port=8081 -> Option A
  4. Quick Check:

    Dot notation + equals sign = correct syntax [OK]
Quick Trick: Use dot notation and equals sign for properties [OK]
Common Mistakes:
  • Using underscores instead of dots
  • Using colon instead of equals sign
  • Swapping key parts order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes