How to write properties file

1. Comment

In the properties by way of comment is the beginning of a # to comment

2. Write properties file

In the properties, a row is a key-value pair, simply means that a variable can be saved row, separated by number between the key and value =

Remember, do not hit double quotation marks ( ""), then hit the read time will read ( "") unless you need double quotation marks
do not have duplicate key values behind or else overwrite the previous value

3. Some examples

# String
person.last-name=john
# int
person.age=112
# boolean
person.boss=false
# Date
person.birth=2019/11/12
# List<Object>
person.dogs[0].name=jj
person.dogs[0].age=111
person.dogs[1].name=tom
person.dogs[1].age=111
# Map<String, Object>
person.maps.Jack=jackc2
person.maps.Iris=yili8
person.maps.Panda=pandax
person.maps.Adun=gengwang
person.maps.Caedmon=chuankwa
# List
person.lists[0]=1
person.lists[1]=2
person.lists[2]=3
person.lists[3]=4
person.lists[4]=5

Guess you like

Origin www.cnblogs.com/ifme/p/11910182.html