Social Sciences, asked by hemanandyini6030, 1 year ago

Why do we use .properties file instead of .txt file?

Answers

Answered by Harshitakhanna
2
In XML you can store more complex (e.g. hierarchical) data than in a properties file. So it depends on your usecase. If you just want to store a small number of direct properties a properties file is easier to handle (though the Java properties class can read XML based properties, too).

It would make sense to keep your configuration interface as generic as possible anyway, so you have no problem to switch to another representation ( e.g. by using Apache Commons Configuration) if you need to.

Similar questions