java write properties file
<p>I have a treemap that has sorted information (I sorted by the hashmap's value, not key) but when I want to write them into the properties file, the order is not sequence. what is the problems? Can any one help me?</p>

<p>ArrayList values = new ArrayList();
                    values.addAll(wordcount.values());</p>

<pre><code>                Collections.sort(values, Collections.reverseOrder());

                ValueComparator bvc = new ValueComparator(wordcount);
                TreeMap&lt;String, Integer&gt; sorted_map = new TreeMap(bvc);
                sorted_map.putAll(wordcount);

                  Properties props=new Properties();
                    FileInputStream fis=new FileInputStream("abc.properties");
                    props.load(fis);
                    for (Integer i : values) { 
                          for (String s : sorted_map.keySet()) { 
                          if (sorted_map.get(s) == i){
                              props.setProperty(s, String.valueOf(i));
                              props.store(new FileOutputStream("abc.properties"), null);
                              break;
                          }

                          }
</code></pre>
