I am trying to modify my existing property file using Properties class methods. The file is getting updated but it does not maintain property order. As for example, if I have data like this:
baseurl=stackoverflow.com
user_id=hello
pass=test123
After updating the file it's not maintaining key=value pairs. Updated file contents change sometimes as below:
pass=test123
baseurl=stackexchange.com
user_id=hell0222
I want my data preserve order as it was before updating. Please suggest me if any of you know how to preserve order in property file.