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?

[356 byte] By [sarmisthaSa] at [2007-11-26 15:14:44]
# 1
The header is only a comment. You can't store the property file with sections. Why do you need sections?Kaj
kajbja at 2007-7-8 9:06:16 > top of Java-index,Java Essentials,Java Programming...
# 2
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.
quittea at 2007-7-8 9:06:16 > top of Java-index,Java Essentials,Java Programming...
# 3
> Why do you need sections?To mimic a Windows.ini file I suppose.
BIJ001a at 2007-7-8 9:06:16 > top of Java-index,Java Essentials,Java Programming...
# 4
> > Why do you need sections?> > To mimic a Windows.ini file I suppose.I thought that they were retired with Windows 3.11 :)
kajbja at 2007-7-8 9:06:16 > top of Java-index,Java Essentials,Java Programming...
# 5
Yes, just to disply it nicely.
sarmisthaSa at 2007-7-8 9:06:16 > top of Java-index,Java Essentials,Java Programming...
# 6

> 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.

DrClapa at 2007-7-8 9:06:16 > top of Java-index,Java Essentials,Java Programming...