Bird
0
0

Which of the following is the correct syntax for setting a server port in application.properties?

easy📝 Syntax Q12 of 15
Spring Boot - Application Configuration
Which of the following is the correct syntax for setting a server port in application.properties?
Aserver.port=8080
Bserver.port => 8080
Cserver.port : 8080
Dserver.port -> 8080
Step-by-Step Solution
Solution:
  1. Step 1: Recall properties file syntax

    In application.properties, each configuration is set as a key=value pair without colons or arrows.
  2. Step 2: Identify the correct key-value format

    The correct syntax uses an equals sign: server.port=8080.
  3. Final Answer:

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

    Properties syntax uses = not : or arrows [OK]
Quick Trick: Properties files always use key=value format [OK]
Common Mistakes:
  • Using colon instead of equals sign
  • Using arrow symbols which are invalid
  • Mixing YAML syntax with properties syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes