yaml语法讲解
application.properties删掉
官方推荐application.yaml
- yaml语法(注意空格)
#properties只能保存键值对!
#key=value
# server.port=8081
#对象
student.name=张三
student.age=18
# yaml语法
# 对空格的要求十分高
server:
port: 8081
#key: value
student:
name: 张三
age: 18
#行内写法
student: {name: 张三,age: 3}
#数组
pets:
- cat
- dog
- pig
pets: [cat,dog,pig]