Why Java Enumeration doesn't return properties list in order?
<p>I'm creating a simple program with the possibility to change the language and I would convert the list of properties in the file myBundle.properties in a String array.</p>

<p>This is the file myBundle.properties:</p>

<pre><code> #default
 test1=Hello1
 test2=Hello2
 test3=Hello3
 test4=Hello4
 test5=Hello5
 test6=Hello6
</code></pre>

<p>And this is the Java code:</p>

<pre><code>import java.util.*;

class BundleTest {

    BundleTest() {
        String[] s = returnStringArray(Locale.ENGLISH);
        for(int i=0; i&lt;s.length; i++) {
            System.out.println(s[i]);
        }
    }

    private String[] returnStringArray(Locale language) {
        try {
            ResourceBundle labels = ResourceBundle.getBundle("myBundle", language);
            Enumeration&lt;String&gt; keys = labels.getKeys();
            Vector v = new Vector();
            String key = null;
            while (keys.hasMoreElements()) {
                v.add(keys.nextElement());
            }
            String[] s = new String[v.size()];
            for(int i=0; i&lt;s.length; i++) {
                s[i] = (String)v.elementAt(i);
            }
            return s;
        } catch (MissingResourceException mre) {
            System.out.println("Risorse della lingua non trovate!");
            return null;
        }
    }

    public static void main(String[] args) {
        new BundleTest();
    }
}
</code></pre>

<p>But, surprisingly, when I execute the program it returns me the strings in a casual order. Why have Enumeration this strange behavior?</p>

<pre><code>bash-4.1$ java BundleTest
test1
test6
test4
test5
test2
test3
</code></pre>
