Bird
0
0

Which of the following is the correct way to specify a property in Spring Boot's application.properties file?

easy📝 Syntax Q12 of 15
Spring Boot - Application Configuration
Which of the following is the correct way to specify a property in Spring Boot's application.properties file?
Aserver.port=8080
Bserver-port:8080
Cserver_port=8080
DserverPort=8080
Step-by-Step Solution
Solution:
  1. Step 1: Recall Spring Boot property syntax

    Spring Boot uses dot notation in application.properties files, like server.port=8080.
  2. Step 2: Check each option's syntax

    server.port=8080 uses correct dot notation. Options B, C, and D use invalid separators or camelCase which are not valid in properties files.
  3. Final Answer:

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

    Properties use dot notation = server.port=8080 [OK]
Quick Trick: Use dot notation for properties in application.properties [OK]
Common Mistakes:
  • Using underscores instead of dots
  • Using colon instead of equals sign
  • Using camelCase instead of dot notation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes