I am trying to port this application from PHP to Java. PHP makes things easy with their associate name arrays and the extract() function. For Java I am thinking about using a HashMap to simulate the Arrays in PHP. Is there a better data structure to use than this? And is there a function similar to extract in Java?
Share
If you want to preserve the order you put the values into the HashMap, then look into using LinkedHashMap. But HashMap is a decent choice if you don’t have that requirement.
http://download.oracle.com/javase/6/docs/api/java/util/LinkedHashMap.html