In my Java code I use LinkedHashMap to store the data and in the end I delete the duplicate and sort the data Removing parts and more results is OK, what I need to do is run a single code with JDK 1.5 on a different Linux server, using JDK 1.6 gives a different result. For example, it does not sort the elements of LinkedHashMap for me or the collections do not work. I really appreciate your advice.
How are you sorting it? A linkedhash is not a sorted map, but it only maintains the entry order. If you need a map that is iterated in sequential order, then you should use
TreeMap , depending on how you are doing, if you select
LinkedHashMap < / Code>, then the order of the map can be different because JDK can sort it in slightly different ways.
Comments
Post a Comment