Sections in properties file
In my file i have few sections and name=value pair.
sectiona
name1=value1
name2=value2
sectionb
name3=value3
name4=value4
Can i do it in one properties class. In Properties.store i see you can write a header. So i guess header will be sectiona.
Do i need to have one properties class for each section?
No. However, you can use prefixes, e.g.sectiona.name1=value1sectiona.name2=value2sectionb.name3=value3sectionb.name4=value4The header is just a single informational header line.
> Yes, just to disply it nicely.
Then don't do this. The Properties.store() method will write your properties in a sequence that appears random. This is no problem for the Properties.load() method because it doesn't care what order the properties appear in. But if people care what order they appear in, then don't use Properties.store() to write the file.