JavaBeginner#spring

What is the difference between application.properties and application.yml in Spring Boot?

Both configure application settings; properties uses flat key=value pairs while yml uses hierarchical, indentation-based syntax that's more readable for nested configuration, and both are functionally equivalent.

Example
# application.properties
server.port=8080
spring.datasource.url=jdbc:mysql://localhost/db

# application.yml
server:
  port: 8080
spring:
  datasource:
    url: jdbc:mysql://localhost/db

Related Questions

1
JavaBeginner#spring

What is the purpose of Spring Boot starters?

Open
2
JavaIntermediate#spring

What is the difference between @RequestParam, @PathVariable, and @RequestBody?

Open
3
JavaIntermediate#spring

What are Spring bean scopes?

Open