Recall & Review
beginner
What is the purpose of the
application.properties file in a Spring Boot project?It is used to configure application settings like server port, database connection, and other properties in a simple key-value format.
Click to reveal answer
beginner
How are properties structured inside
application.properties?Properties are written as key-value pairs separated by an equals sign, for example: <br>
server.port=8080Click to reveal answer
intermediate
How can you organize properties for different environments using
application.properties?You create separate files like
application-dev.properties or application-prod.properties and activate them via the spring.profiles.active property.Click to reveal answer
intermediate
What is the difference between
application.properties and application.yml?application.properties uses simple key-value pairs, while application.yml uses YAML format which supports nested structures and is more readable for complex configs.Click to reveal answer
beginner
Can you use comments in
application.properties? How?Yes, comments start with a hash symbol
#. Anything after # on the line is ignored by Spring Boot.Click to reveal answer
What symbol separates keys and values in
application.properties?✗ Incorrect
In
application.properties, keys and values are separated by an equals sign =.How do you activate a specific profile in Spring Boot?
✗ Incorrect
You set
spring.profiles.active=profileName in application.properties to activate a profile.Which file format supports nested configuration better?
✗ Incorrect
application.yml supports nested structures better than application.properties.How do you write a comment in
application.properties?✗ Incorrect
Comments start with
# in application.properties.What would this line do?
server.port=9090✗ Incorrect
This sets the Spring Boot server to listen on port 9090.
Explain the structure and purpose of the
application.properties file in Spring Boot.Think about how you tell your app what settings to use.
You got /4 concepts.
Describe how to manage different environments using
application.properties files.Consider how you might have different settings for testing and production.
You got /3 concepts.