The problem is that ; I am retrieving a key value data object pair from database it is like
(select * from xyz ORDER BY letter DESC)
3 z,
2 y,
1 x
And Im putting these to a Long, String HashMap pair. The problem is when I putting these to Map pair, the order is changing. It appears as
1 x,
2 y,
3 z
How can i preserve data as in first situation.
Use a LinkedHashMap instead! That will keep the order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With